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

learn more… | top users | synonyms (1)

0
votes
2answers
35 views

PHP include incorrect search path taken?

I have a file test.php in the folder myfolder. myfolder also contains another folder called inner. Both myfolder and inner contain a file called msg.php. The entire layout looks like this: myfolder ...
2
votes
1answer
44 views

Why does missing “require” / “include” call error_handler an extra time?

I have a custom error handler set up using set_error_handler. When I tried to include a file that doesn't exist, PHP calls error_handler one more time than it should: <?php error_reporting(E_ALL | ...
11
votes
1answer
103 views

C PHP Extension object persistance

I've developed a PHP5 client extension for a server application i wrote, and so far it's working quite well, but it doesn't support persistent connections yet. Since this is something i want to ...
5
votes
1answer
135 views

Why is Importing a PHP Function into the Current Namespace Unsupported

According to the PHP documentation PHP namespaces support three kinds of aliasing or importing: aliasing a class name, aliasing an interface name, and aliasing a namespace name. Note that ...
0
votes
1answer
28 views

Calling extension function in zend_eval_string

When i try use zend_eval_string (i make mini php extension), there are no extensions functions avaliable. There are also no errors reporting (if php code have fatal error program exit). What i must ...
0
votes
1answer
82 views

What's the PHP APC cache's apc.shm_strings_buffer setting for?

I'm trying to understand the apc.shm_strings_buffer setting in apc.ini. After restarting PHP, the pie chart in the APC admin shows 8MB of cache is already used, even though there are no cached entries ...
9
votes
7answers
266 views

print_r() adds properties to DateTime objects

Consider the following code sample: $m_oDate = new DateTime('2013-06-12 15:54:25'); print_r($m_oDate); echo $m_oDate->date; Since PHP 5.3, this produces (something like) the following output: ...
1
vote
1answer
56 views

Compiling a php extension into a dll

I've been attempting for a last few days to make use of the operator overloading extension (pecl.php.net/package/operator), which has apparently been updated recently to be compatible with 5.3 and ...
2
votes
3answers
77 views

Capturing (externally) the memory consumption of a given Callback

The Problem Lets say I have this function: function hog($i = 1) // uses $i * 0.5 MiB, returns $i * 0.25 MiB { $s = str_repeat('a', $i * 1024 * 512); return substr($s, $i * 1024 * 256); } I ...
0
votes
1answer
49 views

php extension to replace PHP class method with handler written in C

My level of experience: very comfortable with C, novice to PHP, new to and very frustrated with Zend Engine (no documentation?) I'm trying to write my first PHP extension, and I'm wondering if the ...
0
votes
1answer
209 views

Trying to regenerate zend_language_scanner.c

I'm trying to add a new keyword in PHP (just learning the core), so what I did was: added a new token to zend_language_parser.y, used it in an unticket_statement, compiled PHP, but it didn't work out. ...
2
votes
0answers
50 views

Linking Lame.h with PHP extension

I'm trying to develop my first php extension. It uses Lame , so I've installed liblame-dev lame.h is located at /usr/include/lame/ In my config.m4 LIBNAME=lame PHP_ADD_LIBRARY($LIBNAME) It ...
1
vote
1answer
40 views

Date, Time, DSL and Timezone information handling

Timezone and Daylight Savings information can change without notice. A simple piece of legislation could alter DSL for an area and render datetime information useless for a certain area on the globe, ...
3
votes
1answer
134 views

How to make ZEND_BEGIN_ARG_INFO_EX control number of arguments, passed to a PHP extension?

I'm developing a PHP extension, using C. So far I'm working on the proper validation of arguments, passed to the extension's function from PHP userspace. The macro ZEND_BEGIN_ARG_INFO_EX can be used ...
0
votes
1answer
85 views

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, ...

1 2 3 4 5 7
15 30 50 per page