Questions tagged [php-internals]

How the PHP programming language works underneath, and questions about the underlying C code.

PHP Internals

Tag purpose

The purpose of the tag is to indicate a question about the internals of PHP. Possible questions could be about how references counting or copy on write. E.g. When you want to know what happens under the hood while doing things in PHP. It can also be applied to questions in the tag that deal with extending PHP at the core. This tag should also be used for any questions about the Zend Engine powering PHP.


External Links

269 questions
0
votes
1 answer

Will a PHP local variable passed by reference reliably survive outside a function?

Basically in the case of working with large arrays it's convenient to pass null back if an error occurs since if $array = null then $array[] = 1 is [ 1 ] and null is also usable in a callable context, ie. function (array $array = null) will accept…
srcspider
  • 10,977
  • 5
  • 40
  • 35
0
votes
2 answers

are zend engine globals share memory across processes?

I've been going through PHP's source code and the mysql_pconnect function and noticed it's using some kind of HashTable persistent_list which is defined in zend_globals. The question is, how are this globals and variables are preserved across…
Alex
  • 11,479
  • 6
  • 28
  • 50
0
votes
1 answer

Build PHP extension and use call_user_function

I write a code for build an extension to connect to mysql database via mysql_connect. My code is compiled, but when I want to use my function in PHP, it take a loop and not work probably. here is my C++…
MGH
  • 11
  • 1
  • 7
0
votes
2 answers

Override recursion limits for __get and __set on the same property

Is there a way to Override recursion limits for __get and __set on the same property. I want to be able to handle the second reentry differently than the first entry. This code example isn't practical but the simplest to make the point. class…
kporter
  • 2,684
  • 17
  • 26
0
votes
1 answer

zend engine call parent method

I am now trying to create a custom php extension and a problem I am facing is I dont know how to call a parent method. It is like to be in the class constructor and call the parent's constructor: zval *object, fname; object =…
Wanderson Silva
  • 1,179
  • 1
  • 17
  • 35
0
votes
2 answers

issues in wrapping c++ dll for php5 extension

I am trying to create php 5.2.17 extension for my c++ dll. Iam using Visual studio 2005 on windows xp with Sambar Server 7.0. I have two questions: I could not able to include c++ things (strings or STL maps) in my code.. its giving error like:…
Anil Kumar
  • 493
  • 5
  • 16
-1
votes
1 answer

PHP Double comparision

PHP Version 7.1.7 / Laravel 5.4 dump($this_tour->payments_to_operator_sum()); 1012.0 dump(gettype($this_tour->payments_to_operator_sum())); "double" dump($this_tour->operator_price, gettype($this_tour->operator_price)); "1012.00",…
Sergej Fomin
  • 1,822
  • 3
  • 24
  • 42
-1
votes
1 answer

What happens internally when you invoke a function in php

A function defines the instructions which are to be taken when you invoke the function. That part is crystal clear to me. I also know that when functions are invoked that they are placed on a callstack. But that's about it. What happens internally…
Julian S
  • 361
  • 3
  • 13
-1
votes
2 answers

what happens when I create a object instance of my class

I have two class like this: class one { public $var1 = 'anythig'; } class two { public $var2 = 'anythig'; } I want to know when I create a object instance of these classes what happens? My point is about the values stored in the memory. In…
user4920811
-1
votes
1 answer

php 5.6.1 build configuration error.

I am installing php 5.6.1 on centos 7 from build. I did the standard pull, configure but when I make build I get these configuration errors, even though the process continues and terminates with success. What does this error mean and how can I fix…
robue-a7119895
  • 816
  • 2
  • 11
  • 31
-1
votes
2 answers

How (if possible) to optimize memory in this PHP example

I am trying to understand how PHP handles memory consumption in these two examples. Example: 1 // foo.php class foo{ public function __construct() { $a = new PDO(...); $b = new StdClass; $c =…
robue-a7119895
  • 816
  • 2
  • 11
  • 31
-1
votes
1 answer

Fail to build extension due to ZEND_NUM_ARGS() macros

I'm writing small php extension and have problem when building it. The code: PHP_RINIT_FUNCTION(pstat) { int argc = ZEND_NUM_ARGS(); return SUCCESS; } on make got an error: .... /ext/pstat/pstat.c:122:31: error: 'ht' undeclared (first use…
dtoch
  • 185
  • 1
  • 2
  • 12
-2
votes
2 answers

How to get rid of these warnings after installing zend core?

Really annoying! PHP Warning: PHP Startup: bcmath: Unable to initialize module Module compiled with module API=20060613, debug=0, thread-safety=0 PHP compiled with module API=20060613, debug=0, thread-safety=1 These options need to match in…
Mask
  • 33,129
  • 48
  • 101
  • 125
-4
votes
1 answer

Is the PHP Manual misguiding regarding the output of 'phpinfo()' function?

I'm using Windows 10 Home Single Language Edition which is a 64-bit Operating System on my machine. I've installed the most latest version of XAMPP which has installed PHP 7.2.6 on my machine. I come across the following sentence from the paragraph…
user9059272
1 2 3
17
18