php-internals Questions
41
Solved
All of the sudden I've been having problems with my application that I've never had before. I decided to check the Apache's error log, and I found an error message saying "zend_mm_heap corrupted". ...
Phosphate asked 11/2, 2010 at 21:49
3
Solved
What is the exact order of object deconstruction?
From testing, I have an idea: FIFO for the current scope.
class test1
{
public function __destruct()
{
echo "test1\n";
}
}
class tes...
Microscopic asked 31/12, 2012 at 1:44
1
Under certain circumstances, the built-in function in PHP called mysqli_query returns null. Such behaviour is not foreseen by the function's documentation that explains how to use it, so I tried to...
Puritanical asked 15/5, 2018 at 9:2
8
Solved
Is it possible to see if two array variables point to the same memory location? (they are the same array)
Mantissa asked 5/11, 2010 at 23:33
4
Solved
How does the PHP Internals TSRMLS_FETCH macro do its job?
Per the PHP Manual
While developing extensions, build errors that contain "tsrm_ls is undefined" or errors to that effect stem from the...
Torques asked 28/3, 2018 at 16:34
3
Solved
The title may seem a bit silly but I'm totally serious with this. Today at work I came across a weird PHP behaviour which I could not explain. Luckily this behaviour is fixed in PHP 7.4, so it seem...
Ruction asked 5/11, 2019 at 19:5
2
Solved
I always thought that in_array strict mode will be faster or at least the same speed as non-strict mode. But after some benchmarks I noticed there is a huge difference in execution time between the...
Mothering asked 3/7, 2019 at 12:49
0
As a learning exercise, I'm trying to save the compiled state of a PHP file in order to execute it at a later time without having to go through zend_compile_file again.
The first thing I did...
Torosian asked 25/8, 2018 at 20:29
3
Solved
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.7 on my machine.
I'...
Quell asked 23/6, 2018 at 11:18
3
Solved
I'm curious on how certain php functions are implemented internally. e.g. array_values().
So in eclipse, I control click on the function name, which took me to a page that contain function protot...
Abuse asked 22/4, 2018 at 22:32
2
Solved
I want to know if unused use statements in my class affect performance of my php website?
Does php include all classes in beginning or when need it? If second choice then I think it doesn't affect...
Quiver asked 1/12, 2014 at 11:40
2
Solved
I'm learning PHP extension writing in order to make some old extensions work with PHP 7.
I tried to modify the sample extension from http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extens...
Startle asked 29/12, 2015 at 19:24
1
Solved
What is the reasoning behind the refusal of PHP to accept the return types in this simple situation?
In PHP 7.1.4, using strict typing, I have a simple object oriented setup involving some interfaces, and some classes implementing those interfaces. Below example, as you would expect, works fine.
...
Fraught asked 11/4, 2018 at 19:10
1
Solved
What function or bit of code serves as the main entry point for executing/interpreting a PHP program in the source of PHP itself? Based on things I've googled or read in books, I know that PHP is d...
Glandule asked 22/2, 2018 at 16:39
7
Solved
Let me prefix this by saying that I know what foreach is, does and how to use it. This question concerns how it works under the bonnet, and I don't want any answers along the lines of "this is how ...
Denigrate asked 7/4, 2012 at 19:33
2
They seem to be the same thing, and yet different. I don't know which one is which: I know we can use PDO as new PDO() and use prepare() and query() methods, to fetch data from database. So, if thi...
Palembang asked 23/1, 2017 at 17:56
2
Solved
Since objects are passed by reference by default now, is there maybe some special case when &$obj would make sense?
Hurff asked 11/1, 2014 at 4:9
2
Solved
How can I write PHP opcode, save it in a file and make the Zend Engine execute it? Any method or hack is welcome, as long as it does the trick.
Borneol asked 30/11, 2011 at 12:53
4
Solved
When I was doing a benchmark, I found that PHP 7 was using more memory than PHP 5.6.
So, I did a test. I ran a script containing only:
$a=10;
and below are the results for the memory used when I ...
Pazia asked 28/9, 2016 at 7:10
2
Solved
I declare 100 functions, but I don't actually call any of them. Will having so many functions defined affect loading time?
Does PHP process these functions before they are called?
Chatelain asked 20/7, 2016 at 7:34
1
Solved
if you look at this documentation, the first parameter returns only Zend extensions.
What is exactly a Zend extension, as compared to a PHP ("simple") extension?
Colin asked 19/6, 2016 at 7:44
2
Solved
We have a piece of simple code:
1 <?php
2 $i = 2;
3 $j = &$i;
4 echo (++$i) + (++$i);
On PHP5, it outputs 8, because:
$i is a reference, when we increase $i by ++i, it will change the zv...
Freeload asked 31/3, 2016 at 16:17
1
I want to build a PHP extension that can dynamically inspect every opcode generated from a PHP file and do some checking on that.
I came across several websites and found out a couple of function...
Liesa asked 12/1, 2015 at 14:29
1
Solved
<?php
$s = "foobar";
$t = $s;
$u = $s;
echo PHP_VERSION . "\n";
debug_zval_dump($s);
xdebug_debug_zval('s');
Run in PHP 5.6.16
Run in PHP 7.0.2
I think the result (PHP 7) should be...
Decided asked 13/1, 2016 at 10:23
1
Solved
Simple question.
When or how, by PHP or yourself do generators destroy their stacks?
Take the following example:
function doWork(): Generator
{
// create some objects.
$o1 = new stdClass();
$...
Plebs asked 29/12, 2015 at 14:15
1 Next >
© 2022 - 2024 — McMap. All rights reserved.