<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Serverphorums.com - php-internals</title>
        <description>This is the php-internals list where many discussions (and flames) about the php development are happening.</description>
        <link>http://www.serverphorums.com/list.php?7</link>
        <lastBuildDate>Thu, 23 May 2013 08:05:58 +0200</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,710626,710626#msg-710626</guid>
            <title>[PHP-DEV] ZEND_NS_NAMED_FE is clearly a frequently used macro (1 reply)</title>
            <link>http://www.serverphorums.com/read.php?7,710626,710626#msg-710626</link>
            <description><![CDATA[ It's time to play &quot;Spot the double quoting!&quot;<br />
<br />
#define ZEND_NS_FENTRY(ns, zend_name, name, arg_info, flags)<br />
 ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, #zend_name), name, arg_info, flags)<br />
<br />
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns,<br />
#zend_name, name, arg_info, 0)<br />
<br />
<br />
ZEND_NS_NAMED_FE(&quot;foo&quot;, bar, ...)<br />
<br />
Gets exported to userspace as: foo\&quot;bar&quot; which is obviously fail.<br />
<br />
Any objections to my fixing ZEND_NS_NAMED_FE as: s/#zend/zend/ ?<br />
<br />
-Sara]]></description>
            <dc:creator>Sara Golemon</dc:creator>
            <category>php-internals</category>
            <pubDate>Tue, 21 May 2013 20:30:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,709344,709344#msg-709344</guid>
            <title>[PHP-DEV] [Proposal] Add method to shmop ext to retrieve OS shmid (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,709344,709344#msg-709344</link>
            <description><![CDATA[ This grew out of a question I answered on StackOverflow.com:<br />
<a href="http://stackoverflow.com/questions/16501707/working-with-shared-memory-in-php/" target="_blank"  rel="nofollow">http://stackoverflow.com/questions/16501707/working-with-shared-memory-in-php/</a><br />
<br />
The gist is that a user was converting a C program to PHP and wanted<br />
the shmid as reported by ipcs. The user assumed that the id returned<br />
by shmop_open would be the shmid, and was confused by the shmop<br />
resource identifier. (I explained to him what the return actually was)<br />
<br />
I suggested he use his own unique key to be able to identify the<br />
shared memory created for his script, but he said that it had to be<br />
0x0.<br />
<br />
I've added a function to retrieve shmop-&gt;shmid in my own fork of PHP.<br />
You can see the changes here and the commit message contains a quick<br />
usage/test script:<br />
<a href="https://github.com/nedwidek/php-src/commit/832e77fce15de926b562b6dcc28d1864bb7c348b" target="_blank"  rel="nofollow">https://github.com/nedwidek/php-src/commit/832e77fce15de926b562b6dcc28d1864bb7c348b</a><br />
<br />
So I guess the questions are:<br />
Is there a particular reason that the shmid is hidden from PHP scripts?<br />
Is there any reason not to move this to a formal RFC?<br />
Should similar methods be added to the sysv* extensions where applicable?<br />
Assuming this is an acceptable change to consider, anyone have a<br />
better function name than shmop_sys_shmid?<br />
<br />
Regards,<br />
Erik Nedwidek]]></description>
            <dc:creator>Erik Nedwidek</dc:creator>
            <category>php-internals</category>
            <pubDate>Sun, 19 May 2013 03:40:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,709257,709257#msg-709257</guid>
            <title>[PHP-DEV] hash_pbkdf2 vs openssl_pbkdf2 (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,709257,709257#msg-709257</link>
            <description><![CDATA[ Hi internals!<br />
<br />
I just noticed that we added the PBKDF2 algorithm two times in PHP 5.5.<br />
Once in the hash extension, once in the OpenSSL extension.<br />
<br />
The hash_pbkdf2 function was added via this RFC:<br />
<a href="https://wiki.php.net/rfc/hash_pbkdf2" target="_blank"  rel="nofollow">https://wiki.php.net/rfc/hash_pbkdf2</a><br />
<br />
The openssl_pbkdf2 function probably was not noticed at that time because<br />
it was just commited, but not mentioned anywhere else (NEWS, UPGRADING,<br />
etc). Only saw it in vrana's documentation updates just now. The relevant<br />
commit is here: <a href="https://github.com/php/php-src/commit/f4847ef" target="_blank"  rel="nofollow">https://github.com/php/php-src/commit/f4847ef</a><br />
<br />
It would be nice if we could have only one of those functions. I'm<br />
currently tending towards the hash_ variant because of the commit message<br />
of the openssl_ function:<br />
<br />
&gt; No easy way to put these in the hash extension since we don't really<br />
support optional<br />
&gt; parameters to certain algorithms. Implemented in openssl for now since it<br />
has it already<br />
&gt; and is pretty stable.<br />
&gt;<br />
&gt; Only SHA1 is confirmed to work as an algorithm but openssl has a<br />
parameter so it can be<br />
&gt; changed in the future.<br />
<br />
It seems that the author already would have preferred it in the hash<br />
extension and that the openssl variant only works with sha1 (or was only<br />
tested with it? not sure).<br />
<br />
Nikita]]></description>
            <dc:creator>Nikita Popov</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 18 May 2013 11:50:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,708749,708749#msg-708749</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Add optional second arg to unserialize(): ext/standard/basic_functions.c ext/standard/tests/serialize/serialization_error_001.phpt ext/standard/tests/serialize/unserialize_consumed.phpt ext/standard/var.c (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,708749,708749#msg-708749</link>
            <description><![CDATA[ Hi!<br />
<br />
&gt; Imho this should have been briefly discussed on internals beforehand. At<br />
&gt; least to me this seems rather dubious (why is it needed? why are you<br />
&gt; manually parsing a part of the DLL serialization?) and also clashes with<br />
&gt; Stas' proposed changes to unserialize.<br />
<br />
I don't remember any discussion and I think it's rather sad that we're<br />
back to &quot;commit first, ask anybody else maybe&quot; paradigm. There<br />
definitely should be notification on the list prior to changing API of<br />
one of the very frequently used functions in the core.<br />
-- <br />
Stanislav Malyshev, Software Architect<br />
SugarCRM: <a href="http://www.sugarcrm.com/" target="_blank"  rel="nofollow">http://www.sugarcrm.com/</a><br />
(408)454-6900 ext. 227<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Stas Malyshev</dc:creator>
            <category>php-internals</category>
            <pubDate>Fri, 17 May 2013 19:20:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,708744,708744#msg-708744</guid>
            <title>[PHP-DEV] Stand alone GD status? (2 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,708744,708744#msg-708744</link>
            <description><![CDATA[ Hi Folks,<br />
<br />
I tried to post this note via the web interace, but I don't think it made<br />
it, so here it is again. I finally figured out how to subscribe to the list<br />
properly.<br />
<br />
(side NOTE: how to subscribe to the lists is very poorly documented --<br />
there is nice whole page about all the php lists, but no links or docs<br />
about how to subscribe. Elsewhere, I found how to subscribe to php-general,<br />
and extrapolated from that -- however, it took a bunch of failed attempts,<br />
and much frustration, before I figured out that list list is called<br />
&quot;internals&quot; rather than &quot;php.internals&quot; or &quot;php-internals&quot;, or ???. But I<br />
guess that weeds out the less-persistent!)<br />
<br />
Sorry if it's a repeat.<br />
<br />
I'm interesting in the status of the GD lib as a stand-alone library. I'd<br />
like to use it on it's own, and perhaps write some new python bindings for<br />
it.<br />
<br />
But as we all know the state of libGD's web presence is confusing (though<br />
recently improved). I have found it hard to:<br />
<br />
1) know which source code I should use<br />
2) find the docs<br />
3) figure out where to ask questions, perhaps post patches, etc. (why I'm<br />
posting to this list)<br />
<br />
So;<br />
<br />
a) is there a mailing list or something that I missed?<br />
b) is there interest (probably from Pierre or Tom) to continue to maintain<br />
it, clean up its web presence, etc.? (note -- there really isn'ta ll that<br />
much to do to improve the situation a lot -- simply putting all the code,<br />
docs, and a small info page all in one place, and having a mailing list)<br />
<br />
I like GD, as it is simple, fast, and does what I need it to do. I'd rather<br />
not get into the mess of Cairo, or AGG, or skia (though skia does look<br />
pretty promising...). But I do need to know that there's some support<br />
before committing much effort to it.<br />
<br />
-Chris<br />
<br />
-- <br />
<br />
Christopher Barker, Ph.D.<br />
Oceanographer<br />
<br />
Emergency Response Division<br />
NOAA/NOS/OR&amp;R            (206) 526-6959   voice<br />
7600 Sand Point Way NE   (206) 526-6329   fax<br />
Seattle, WA  98115       (206) 526-6317   main reception<br />
<br />
<a href="mailto:&#67;&#104;&#114;&#105;&#115;&#46;&#66;&#97;&#114;&#107;&#101;&#114;&#64;&#110;&#111;&#97;&#97;&#46;&#103;&#111;&#118;">&#67;&#104;&#114;&#105;&#115;&#46;&#66;&#97;&#114;&#107;&#101;&#114;&#64;&#110;&#111;&#97;&#97;&#46;&#103;&#111;&#118;</a>]]></description>
            <dc:creator>Chris Barker - NOAA Federal</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 18 May 2013 00:20:05 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,708737,708737#msg-708737</guid>
            <title>[PHP-DEV] php-fpm and systemd integration (5 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,708737,708737#msg-708737</link>
            <description><![CDATA[ Hi,<br />
<br />
I plan to allow php-fpm to be aware of systemd and so, use the<br />
type=notify mode.<br />
<br />
I'd like to apply to attached patch to 5.4 and 5.5, as this change have<br />
no impact on standard build (need new --with-fpm-systemd build option).<br />
<br />
Any feedback before I process ?<br />
<br />
<br />
Remi.<br />
diff -up ../sapi/fpm/config.m4.systemd ../sapi/fpm/config.m4<br />
--- ../sapi/fpm/config.m4.systemd	2013-05-08 18:45:31.000000000 +0200<br />
+++ ../sapi/fpm/config.m4	2013-05-17 12:20:19.199841304 +0200<br />
@@ -563,6 +563,26 @@ if test &quot;$PHP_FPM&quot; != &quot;no&quot;; then<br />
   [  --with-fpm-group[=GRP]  Set the group for php-fpm to run as. For a system user, this <br />
                   should usually be set to match the fpm username (default: nobody)], nobody, no)<br />
 <br />
+  PHP_ARG_WITH(fpm-systemd,,<br />
+  [  --with-fpm-systemd      Activate systemd integration], no, no)<br />
+<br />
+  if test &quot;$PHP_FPM_SYSTEMD&quot; != &quot;no&quot; ; then<br />
+    AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS=&quot;-lsystemd-daemon&quot;)<br />
+    AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H=&quot;yes&quot;], [HAVE_SD_DAEMON_H=&quot;no&quot;])<br />
+    if test $HAVE_SD_DAEMON_H = &quot;no&quot; || test -z &quot;${SYSTEMD_LIBS}&quot;; then<br />
+      AC_MSG_ERROR([Your system does not support systemd.])<br />
+    else<br />
+      AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])<br />
+      PHP_FPM_SD_FILES=&quot;fpm/fpm_systemd.c&quot;<br />
+      PHP_ADD_LIBRARY(systemd-daemon)<br />
+      php_fpm_systemd=notify<br />
+    fi<br />
+  else<br />
+    php_fpm_systemd=simple<br />
+  fi<br />
+  PHP_SUBST_OLD(php_fpm_systemd)<br />
+  AC_DEFINE_UNQUOTED(PHP_FPM_SYSTEMD, &quot;$php_fpm_systemd&quot;, [fpm systemd service type])<br />
+<br />
   if test -z &quot;$PHP_FPM_USER&quot; -o &quot;$PHP_FPM_USER&quot; = &quot;yes&quot; -o &quot;$PHP_FPM_USER&quot; = &quot;no&quot;; then<br />
     php_fpm_user=&quot;nobody&quot;<br />
   else<br />
@@ -631,7 +651,7 @@ if test &quot;$PHP_FPM&quot; != &quot;no&quot;; then<br />
 		fpm/events/port.c \<br />
   &quot;<br />
 <br />
-  PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)')<br />
+  PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES $PHP_FPM_SD_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)')<br />
 <br />
   case $host_alias in<br />
       *aix*)<br />
diff -up ../sapi/fpm/fpm/fpm_events.c.systemd ../sapi/fpm/fpm/fpm_events.c<br />
--- ../sapi/fpm/fpm/fpm_events.c.systemd	2013-05-08 18:45:31.000000000 +0200<br />
+++ ../sapi/fpm/fpm/fpm_events.c	2013-05-17 13:13:10.854896820 +0200<br />
@@ -29,6 +29,10 @@<br />
 #include &quot;events/port.h&quot;<br />
 #include &quot;events/kqueue.h&quot;<br />
 <br />
+#ifdef HAVE_SYSTEMD<br />
+#include &quot;fpm_systemd.h&quot;<br />
+#endif<br />
+<br />
 #define fpm_event_set_timeout(ev, now) timeradd(&amp;(now), &amp;(ev)-&gt;frequency, &amp;(ev)-&gt;timeout);<br />
 <br />
 static void fpm_event_cleanup(int which, void *arg);<br />
@@ -361,6 +365,10 @@ void fpm_event_loop(int err) /* {{{ */<br />
 <br />
 		zlog(ZLOG_DEBUG, &quot;%zu bytes have been reserved in SHM&quot;, fpm_shm_get_size_allocated());<br />
 		zlog(ZLOG_NOTICE, &quot;ready to handle connections&quot;);<br />
+<br />
+#ifdef HAVE_SYSTEMD<br />
+		fpm_systemd_heartbeat(NULL, 0, NULL);<br />
+#endif<br />
 	}<br />
 <br />
 	while (1) {<br />
diff -up ../sapi/fpm/fpm/fpm_systemd.c.systemd ../sapi/fpm/fpm/fpm_systemd.c<br />
--- ../sapi/fpm/fpm/fpm_systemd.c.systemd	2013-05-17 12:20:19.200841309 +0200<br />
+++ ../sapi/fpm/fpm/fpm_systemd.c	2013-05-17 14:18:36.851079208 +0200<br />
@@ -0,0 +1,74 @@<br />
+#include &quot;fpm_config.h&quot;<br />
+<br />
+#include &lt;sys/types.h&gt;<br />
+#include &lt;systemd/sd-daemon.h&gt;<br />
+<br />
+#include &quot;fpm.h&quot;<br />
+#include &quot;fpm_clock.h&quot;<br />
+#include &quot;fpm_worker_pool.h&quot;<br />
+#include &quot;fpm_scoreboard.h&quot;<br />
+#include &quot;zlog.h&quot;<br />
+#include &quot;fpm_systemd.h&quot;<br />
+<br />
+<br />
+static void fpm_systemd() /* {{{ */<br />
+{<br />
+	static unsigned long int last=0;<br />
+	struct fpm_worker_pool_s *wp;<br />
+	unsigned long int requests=0, slow_req=0;<br />
+	int active=0, idle=0, rv;<br />
+<br />
+<br />
+	for (wp = fpm_worker_all_pools; wp; wp = wp-&gt;next) {<br />
+		if (wp-&gt;scoreboard) {<br />
+			active   += wp-&gt;scoreboard-&gt;active;<br />
+			idle     += wp-&gt;scoreboard-&gt;idle;<br />
+			requests += wp-&gt;scoreboard-&gt;requests;<br />
+			slow_req += wp-&gt;scoreboard-&gt;slow_rq;<br />
+		}<br />
+	}<br />
+/*<br />
+	zlog(ZLOG_DEBUG, &quot;systemd heartbeat (Processes active:%d, idle:%d, Requests:%lu, slow:%lu, Traffic:%.3greq/sec)&quot;, <br />
+			active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / FPM_SYSTEMD_HEARTBEAT);<br />
+*/<br />
+	rv = sd_notifyf(0, &quot;READY=1\n&quot;<br />
+				&quot;STATUS=Processes active: %d, idle: %d, Requests: %lu, slow: %lu, Traffic: %.3greq/sec&quot;,<br />
+				active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / FPM_SYSTEMD_HEARTBEAT);<br />
+<br />
+	if (rv &lt; 0) {<br />
+		zlog(ZLOG_NOTICE, &quot;failed to notify systemd&quot;);<br />
+	}<br />
+<br />
+	last = requests;<br />
+}<br />
+/* }}} */<br />
+<br />
+void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg) /* {{{ */<br />
+{<br />
+	static struct fpm_event_s heartbeat;<br />
+<br />
+	if (fpm_globals.parent_pid != getpid()) {<br />
+		return; /* sanity check */<br />
+	}<br />
+<br />
+	if (which == FPM_EV_TIMEOUT) {<br />
+		fpm_systemd();<br />
+<br />
+		return;<br />
+	}<br />
+<br />
+	if (sd_notifyf(0, &quot;READY=1\n&quot;<br />
+			          &quot;STATUS=ready to handle connections\n&quot;<br />
+			          &quot;MAINPID=%lu&quot;,<br />
+			          (unsigned long) getpid()) &lt; 0) {<br />
+		zlog(ZLOG_WARNING, &quot;failed to notify systemd&quot;);<br />
+	} else {<br />
+		zlog(ZLOG_DEBUG, &quot;have notify systemd&quot;);<br />
+	}<br />
+<br />
+	/* first call without setting which to initialize the timer */<br />
+	fpm_event_set_timer(&amp;heartbeat, FPM_EV_PERSIST, &amp;fpm_systemd_heartbeat, NULL);<br />
+	fpm_event_add(&amp;heartbeat, FPM_SYSTEMD_HEARTBEAT);<br />
+}<br />
+/* }}} */	<br />
+<br />
diff -up ../sapi/fpm/fpm/fpm_systemd.h.systemd ../sapi/fpm/fpm/fpm_systemd.h<br />
--- ../sapi/fpm/fpm/fpm_systemd.h.systemd	2013-05-17 12:20:19.200841309 +0200<br />
+++ ../sapi/fpm/fpm/fpm_systemd.h	2013-05-17 14:02:37.400247799 +0200<br />
@@ -0,0 +1,12 @@<br />
+#ifndef FPM_SYSTEMD_H<br />
+#define FPM_SYSTEMD_H 1<br />
+<br />
+#include &quot;fpm_events.h&quot;<br />
+<br />
+/* 10s (in ms) heartbeat for systemd status */<br />
+#define FPM_SYSTEMD_HEARTBEAT (10000)<br />
+<br />
+void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg);<br />
+<br />
+#endif<br />
+<br />
diff -up ../sapi/fpm/php-fpm.service.in.systemd ../sapi/fpm/php-fpm.service.in<br />
--- ../sapi/fpm/php-fpm.service.in.systemd	2013-05-08 18:45:31.000000000 +0200<br />
+++ ../sapi/fpm/php-fpm.service.in	2013-05-17 12:20:19.201841314 +0200<br />
@@ -3,6 +3,7 @@ Description=The PHP FastCGI Process Mana<br />
 After=syslog.target network.target<br />
 <br />
 [Service]<br />
+Type=@php_fpm_systemd@<br />
 PIDFile=@localstatedir@/run/php-fpm.pid<br />
 ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf<br />
 ExecReload=/bin/kill -USR2 $MAINPID<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Remi Collet</dc:creator>
            <category>php-internals</category>
            <pubDate>Thu, 23 May 2013 07:20:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,708565,708565#msg-708565</guid>
            <title>[PHP-DEV] Firebird PDO Fixes (1 reply)</title>
            <link>http://www.serverphorums.com/read.php?7,708565,708565#msg-708565</link>
            <description><![CDATA[ Hello,<br />
<br />
I have some fixes for pdo-firebird I sent as pull requests on github. I<br />
contacted the php developer Mariuz, but he's currently busy and is unable<br />
to review and commit the changes to master.<br />
<br />
Could someone please review them for inclusion in the next php release?<br />
<br />
Thanks.<br />
<br />
-- <br />
Matheus Degiovani<br />
Gigatron Franchising<br />
(18) 3642-9008<br />
MSN: <a href="mailto:&#109;&#97;&#116;&#104;&#101;&#117;&#115;&#64;&#103;&#105;&#103;&#97;&#116;&#114;&#111;&#110;&#46;&#99;&#111;&#109;&#46;&#98;&#114;">&#109;&#97;&#116;&#104;&#101;&#117;&#115;&#64;&#103;&#105;&#103;&#97;&#116;&#114;&#111;&#110;&#46;&#99;&#111;&#109;&#46;&#98;&#114;</a><br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Matheus Degiovani</dc:creator>
            <category>php-internals</category>
            <pubDate>Mon, 20 May 2013 09:40:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,707828,707828#msg-707828</guid>
            <title>[PHP-DEV] Memory leak in include()/require() ? (8 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,707828,707828#msg-707828</link>
            <description><![CDATA[ hi, did anyone come across the memory leak of require()/include(),<br />
I just saw this bug report: <a href="https://bugs.php.net/bug.php?id=47038" target="_blank"  rel="nofollow">https://bugs.php.net/bug.php?id=47038</a>, <br />
but it was closed with nothing explained.<br />
<br />
<br />
the php version I used:<br />
<br />
php --version<br />
PHP 5.3.6-13ubuntu3.9 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:27)<br />
Copyright (c) 1997-2011 The PHP Group<br />
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies<br />
<br />
<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>peter wang</dc:creator>
            <category>php-internals</category>
            <pubDate>Fri, 17 May 2013 10:00:05 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,707316,707316#msg-707316</guid>
            <title>[PHP-DEV] OPCache documentation (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,707316,707316#msg-707316</link>
            <description><![CDATA[ Hi all,<br />
<br />
As you know, 5.5 final is coming soon.<br />
We are in RC, so mainly stabilizing stuff and preparing the final release<br />
for anyone to setup 5.5 on their servers.<br />
<br />
I see the documentation migration guide has already been commited, that's a<br />
good new.<br />
I also see that new features we ship in 5.5 are online in the<br />
documentation, great !<br />
<br />
But a crucial feature is missing doc : OPCache.<br />
<br />
As this feature is a very big step in PHP's life (we finally have a<br />
recommanded, bundled opcode cache system, and I'm very proud of this<br />
personnaly), I think it is crucial to have a good documentation about it.<br />
<br />
Has anyone started to write some doc about OPCache ?<br />
<br />
Another subject is APC. We have its doc on php.net, all right.<br />
What I would like is we patch APC doc when 5.5 final gets released, to<br />
clearly show our mind about it.<br />
That way, any people using 5.5 should be able to read in the doc that APC<br />
has support has been interrupted, that APC should never be used together<br />
with OPCache, and that OPCache is now the standard recommanded OPCode<br />
caching solution for 5.5, 5.4 and 5.3.<br />
<br />
It is crucial to communicate one this point for our users.<br />
<br />
Then will come the &quot;User cache&quot; debate<br />
<br />
Thank you.<br />
<br />
Julien.Pauli]]></description>
            <dc:creator>Julien Pauli</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 15 May 2013 16:00:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,707291,707291#msg-707291</guid>
            <title>[PHP-DEV] [PROPOSAL] apparmor change_hat functionality in fpm (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,707291,707291#msg-707291</link>
            <description><![CDATA[ Hi!<br />
<br />
The basic idea behind this is to get a better seperation of different php<br />
pools (so e.g. php scripts from one pool can't access the other and vice<br />
versa).<br />
<br />
I did a small patch (https://github.com/php/php-src/pull/343) that adds a<br />
configuration parameter to pools (apparmor_hat). If this is set, workers of<br />
the pool try to change the apparmor hat to the specified value.<br />
The patch only touches fpm. Only thing that's needed is libapparmor - if it<br />
is not there the functionality just gets left out.<br />
<br />
To keep things simple this version is very coarse - meaning it is not<br />
possible to change the hat back, or change to a different hat according to<br />
the executed script.<br />
<br />
<br />
Any thoughts on this?<br />
<br />
Cheers,<br />
Gernot]]></description>
            <dc:creator>Gernot Vormayr</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 15 May 2013 15:10:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,707290,707290#msg-707290</guid>
            <title>[PHP-DEV] [PROPOSAL] apparmor change_hat functionality in fpm (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,707290,707290#msg-707290</link>
            <description><![CDATA[ Hi!<br />
<br />
The basic idea behind this is to get a better seperation of different php<br />
pools (so e.g. php scripts from one pool can't access the other and vice<br />
versa).<br />
<br />
I did a small patch (https://github.com/php/php-src/pull/343) that adds a<br />
configuration parameter to pools (apparmor_hat). If this is set, workers of<br />
the pool try to change the apparmor hat to the specified value.<br />
The patch only touches fpm. Only thing that's needed is libapparmor - if it<br />
is not there the functionality just gets left out.<br />
<br />
To keep things simple this version is very coarse - meaning it is not<br />
possible to change the hat back, or change to a different hat according to<br />
the executed script.<br />
<br />
<br />
Any thoughts on this?]]></description>
            <dc:creator>Gernot Vormayr</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 15 May 2013 15:10:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,706385,706385#msg-706385</guid>
            <title>[PHP-DEV] MultipleIterator, add a default value (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,706385,706385#msg-706385</link>
            <description><![CDATA[ Hi internals,<br />
<br />
I propose to ameliorate the MultipleIterator class.<br />
<br />
When a MultipleIterator instance has the MIT_NEED_ANY flag, and when one <br />
of the attached iterators has reached its end, the returned value is <br />
NULL. I propose to change this behavior by allowing a different default <br />
value.<br />
<br />
Example with no default value:<br />
<br />
     $it = new \MultipleIterator(<br />
         \MultipleIterator::MIT_NEED_ANY<br />
       | \MultipleIterator::MIT_KEYS_ASSOC<br />
     );<br />
     $it-&gt;attachIterator(new \ArrayIterator(['a', 'b', 'c']), 'foo');<br />
     $it-&gt;attachIterator(new \ArrayIterator(['x']),           'bar');<br />
<br />
     foreach($it as $value)<br />
         echo $value['foo'], ' =&gt; ', $value['bar'], &quot;\n&quot;;<br />
<br />
     /**<br />
      * Will output:<br />
      *     a =&gt; x<br />
      *     b =&gt;<br />
      *     c =&gt;<br />
      */<br />
<br />
Example with 42 as a default value (given as a third parameter of the <br />
MultipleIterator::attachIterator method):<br />
<br />
     $it-&gt;attachIterator(new \ArrayIterator(['a', 'b', 'c']), 'foo', 42);<br />
     $it-&gt;attachIterator(new \ArrayIterator(['x']),           'bar', 42);<br />
<br />
     foreach($it as $value)<br />
         echo $value['foo'], ' =&gt; ', $value['bar'], &quot;\n&quot;;<br />
<br />
     /**<br />
      * Will output:<br />
      *     a =&gt; x<br />
      *     b =&gt; 42<br />
      *     c =&gt; 42<br />
      */<br />
<br />
It is clearly useful when one of the iterators returns an array, used <br />
directly in a loop. To avoid a &quot;NULL pointer exception&quot;, we can specify <br />
an empty array as a default value.<br />
<br />
A PHP implementation is pretty easy to do. Naively, we are able to write <br />
<a href="https://github.com/hoaproject/Iterator/commit/59dcff7f331a7338644cf9a8965d2a934a38661e" target="_blank"  rel="nofollow">https://github.com/hoaproject/Iterator/commit/59dcff7f331a7338644cf9a8965d2a934a38661e</a>.<br />
<br />
If you think it can be useful, I propose to write a RFC with a patch.<br />
<br />
Thoughts?<br />
<br />
-- <br />
Ivan Enderlin<br />
Developer of Hoa<br />
<a href="http://hoa-project.net/" target="_blank"  rel="nofollow">http://hoa-project.net/</a><br />
<br />
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)<br />
<a href="http://disc.univ-fcomte.fr/" target="_blank"  rel="nofollow">http://disc.univ-fcomte.fr/</a> and <a href="http://www.inria.fr/" target="_blank"  rel="nofollow">http://www.inria.fr/</a><br />
<br />
Member of HTML and WebApps Working Group of W3C<br />
<a href="http://w3.org/" target="_blank"  rel="nofollow">http://w3.org/</a>]]></description>
            <dc:creator>Ivan Enderlin @ Hoa</dc:creator>
            <category>php-internals</category>
            <pubDate>Tue, 14 May 2013 10:40:03 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,705797,705797#msg-705797</guid>
            <title>[PHP-DEV] Heads up - PECL ZendOptimizerPlus repository moved to github.com/zendtech/ZendOptimizerPlus (1 reply)</title>
            <link>http://www.serverphorums.com/read.php?7,705797,705797#msg-705797</link>
            <description><![CDATA[ For those of you with direct clones of ZendOptimizerPlus, you’d have to run:<br />
<br />
git remote set-url origin <a href="mailto:&#103;&#105;&#116;&#64;&#103;&#105;&#116;&#104;&#117;&#98;&#46;&#99;&#111;&#109;">&#103;&#105;&#116;&#64;&#103;&#105;&#116;&#104;&#117;&#98;&#46;&#99;&#111;&#109;</a>:zendtech/ZendOptimizerPlus.git<br />
<br />
on your clones for them to continue working.  This is not related to the<br />
code that’s already inside the PHP tree.<br />
<br />
<br />
<br />
Zeev]]></description>
            <dc:creator>Zeev Suraski</dc:creator>
            <category>php-internals</category>
            <pubDate>Mon, 13 May 2013 16:10:03 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,705384,705384#msg-705384</guid>
            <title>[PHP-DEV] [RFC] Internal operator overloading and GMP improvements (17 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,705384,705384#msg-705384</link>
            <description><![CDATA[ Hi internals!<br />
<br />
<a href="https://wiki.php.net/rfc/operator_overloading_gmp" target="_blank"  rel="nofollow">https://wiki.php.net/rfc/operator_overloading_gmp</a><br />
<br />
This RFC proposes to add operator overloading for INTERNAL classes.<br />
Furthermore it exemplarily implements the new API for GMP.<br />
<br />
Thanks,<br />
Nikita]]></description>
            <dc:creator>Nikita Popov</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 15 May 2013 07:20:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,705042,705042#msg-705042</guid>
            <title>[PHP-DEV] How about make php php-cgi php-fpm to use a common shared library. (1 reply)</title>
            <link>http://www.serverphorums.com/read.php?7,705042,705042#msg-705042</link>
            <description><![CDATA[ This is my ugly patch for this.<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>xinglp</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 11 May 2013 11:20:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,704586,704586#msg-704586</guid>
            <title>[PHP-DEV] Re: [PHP-CVS] com php-src: Address feature request #38917 for native SPKAC (HTML5 keygen element) support: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_spki_export.phpt ext/openssl/tests/openssl_spki_export_challenge (10 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,704586,704586#msg-704586</link>
            <description><![CDATA[ Am 07.05.2013 00:36, schrieb Jason Gerfen:<br />
&gt; Commit:    8f56ac8401ed1c3e00b8fba3fb8e5efb565180c4<br />
&gt; Author:    jas- &lt;jason.gerfen@gmail.com&gt;         Mon, 6 May 2013 16:36:06 -0600<br />
&gt; Parents:   da07e91c3a7e7bac2e380f24c59f70c1bcb3e7e4<br />
&gt; Branches:  master<br />
&gt; <br />
&gt; Link:       <a href="http://git.php.net/?p=php-src.git;a=commitdiff;h=8f56ac8401ed1c3e00b8fba3fb8e5efb565180c4" target="_blank"  rel="nofollow">http://git.php.net/?p=php-src.git;a=commitdiff;h=8f56ac8401ed1c3e00b8fba3fb8e5efb565180c4</a><br />
&gt; <br />
&gt; Log:<br />
&gt; Address feature request #38917 for native SPKAC (HTML5 keygen element) support<br />
&gt; <br />
&gt; Bugs:<br />
&gt; <a href="https://bugs.php.net/38917" target="_blank"  rel="nofollow">https://bugs.php.net/38917</a><br />
&gt; <br />
&gt; Changed paths:<br />
&gt;   M  ext/openssl/openssl.c<br />
&gt;   M  ext/openssl/php_openssl.h<br />
&gt;   A  ext/openssl/tests/openssl_spki_export.phpt<br />
&gt;   A  ext/openssl/tests/openssl_spki_export_challenge.phpt<br />
&gt;   A  ext/openssl/tests/openssl_spki_new.phpt<br />
&gt;   A  ext/openssl/tests/openssl_spki_verify.phpt<br />
<br />
 Any chance of getting this into PHP 5.5? This patch has been waiting<br />
 around since 2006 ...<br />
<br />
-- <br />
Sebastian Bergmann                    Co-Founder and Principal Consultant<br />
<a href="http://sebastian-bergmann.de/" target="_blank"  rel="nofollow">http://sebastian-bergmann.de/</a>                           <a href="http://thePHP.cc/" target="_blank"  rel="nofollow">http://thePHP.cc/</a><br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Sebastian Bergmann</dc:creator>
            <category>php-internals</category>
            <pubDate>Tue, 21 May 2013 17:20:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,704104,704104#msg-704104</guid>
            <title>[PHP-DEV] exceptions during __toString() (3 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,704104,704104#msg-704104</link>
            <description><![CDATA[ I just ran into this issue again:<br />
<br />
<a href="http://stackoverflow.com/questions/2429642/why-its-impossible-to-throw-exception-from-tostring" target="_blank"  rel="nofollow">http://stackoverflow.com/questions/2429642/why-its-impossible-to-throw-exception-from-tostring</a><br />
<br />
Instead of throwing some nonsense &quot;you're not allowed to throw from here&quot;<br />
error-message, how about actually unwinding the stack and passing the<br />
exception to the global exception-handler?<br />
<br />
I understand there's a technical limitation making it difficult/impossible<br />
to handle exceptions during __toString() - and it looks like you can still<br />
try {...} catch (Exception $e) in __toString() just fine, but then what?<br />
You have the exception, but you have no way to pass it to the standard<br />
global exception-handler.<br />
<br />
If the script has to terminate either way, why not terminate the same way<br />
an unhandled exception would normally cause the script to terminate?<br />
<br />
E.g. output the actual error-message, or pass it to whatever was registered<br />
with register_exception_handler() so it can be output or handled in the<br />
usual way?]]></description>
            <dc:creator>Rasmus Schultz</dc:creator>
            <category>php-internals</category>
            <pubDate>Fri, 10 May 2013 13:00:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,704000,704000#msg-704000</guid>
            <title>[PHP-DEV] 5.4.15 and PHP 5.3.25 released! (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,704000,704000#msg-704000</link>
            <description><![CDATA[ Hello!<br />
<br />
The PHP development team announces the immediate availability of PHP<br />
5.4.15 and PHP 5.3.25. These releases fix about 10 bugs. All users of<br />
PHP are encouraged to upgrade to PHP 5.4. PHP 5.3.25 is recommended<br />
for those wishing to remain on the 5.3 series.<br />
<br />
The full list of changes are recorded in the ChangeLog on<br />
<a href="http://www.php.net/ChangeLog-5.php" target="_blank"  rel="nofollow">http://www.php.net/ChangeLog-5.php</a><br />
<br />
For source downloads of PHP 5.4.15 and PHP 5.3.25 please visit our<br />
downloads page at <a href="http://www.php.net/downloads.php" target="_blank"  rel="nofollow">http://www.php.net/downloads.php</a><br />
<br />
Windows binaries can be found on <a href="http://windows.php.net/download/" target="_blank"  rel="nofollow">http://windows.php.net/download/</a><br />
<br />
Stanislav Malyshev         Johannes Schlüter<br />
PHP 5.4 Release Master     PHP 5.3 Release Master<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Stas Malyshev</dc:creator>
            <category>php-internals</category>
            <pubDate>Thu, 09 May 2013 21:00:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,703948,703948#msg-703948</guid>
            <title>[PHP-DEV] list() inside a foreach() (3 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,703948,703948#msg-703948</link>
            <description><![CDATA[ Hi,<br />
<br />
trying out the following source I was astonished to see that using<br />
list() does not work directly in a foreach() but works fine if used<br />
through a temporary variable.<br />
<br />
Would allowing using list() inside the foreach()-statement be desired<br />
behaviour? Or is it just me? :-)<br />
<br />
<br />
  $a = array(<br />
        array(5, 'A'),<br />
        array(3, 'B'),<br />
  );<br />
  foreach($a as list($k, $v)) {<br />
        echo $k;<br />
  }<br />
<br />
Expected output: 53<br />
<br />
Result: syntax error, unexpected 'list' (T_LIST) in ...<br />
<br />
<br />
Works:<br />
  foreach($a as $b) {<br />
	list($k, $v) = $b;<br />
        echo $k;<br />
  }<br />
<br />
<br />
Kind regards,<br />
 Stefan<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Stefan Neufeind</dc:creator>
            <category>php-internals</category>
            <pubDate>Thu, 09 May 2013 18:50:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,703807,703807#msg-703807</guid>
            <title>[PHP-DEV] PHP 5.5 and APC user cache upgrade path (7 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,703807,703807#msg-703807</link>
            <description><![CDATA[ Hi,<br />
<br />
I am testing PHP 5.5 atm and how we can package it for Arch Linux and<br />
provide an upgrade path for users. The RC1 looks pretty solid so far.<br />
<br />
As the new opcache does not provide a user cache to store custom<br />
variables, I would be glad if you could clarify what the best migration<br />
from 5.4 would be.<br />
* Is APC basically dead and wont support PHP 5.5?<br />
* Should APC users switch to opcache and APCu? (with APCu replacing the<br />
APC package)<br />
<br />
For PHP application developers:<br />
* Regarding APCu: it provides the old PHP interface function as well as<br />
their own apcu_* functions. They are aliases right now. Should<br />
application developers think about switching to the apcu_-API as new<br />
features will be available only here?<br />
<br />
Bonus question:<br />
* Right now very similar functionality is provided by APCu, XCache,<br />
WinCache, YAC etc.. Are there plans to include such functionality inside<br />
PHP in future to make application developers life a little easier? At<br />
least a common API would be great. There were several bugs in<br />
applications as these modules behave a little different regarding return<br />
values etc..<br />
<br />
Greetings,<br />
<br />
Pierre<br />
<br />
-- <br />
Pierre Schmitz, <a href="https://pierre-schmitz.com" target="_blank"  rel="nofollow">https://pierre-schmitz.com</a><br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Pierre Schmitz</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 11 May 2013 15:00:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,703725,703725#msg-703725</guid>
            <title>[PHP-DEV] First RC of PHP5.5 available (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,703725,703725#msg-703725</link>
            <description><![CDATA[ Hi Internals,<br />
<br />
Our RC1 of PHP 5.5.0 has been released for testing. It fixes some bugs and<br />
possible memleaks against last beta.<br />
You'll find details in the NEWS file.<br />
<br />
The packages can be found at:<br />
<br />
  <a href="http://downloads.php.net/dsp" target="_blank"  rel="nofollow">http://downloads.php.net/dsp</a><br />
<br />
and windows packages at<br />
<br />
  <a href="http://windows.php.net/qa" target="_blank"  rel="nofollow">http://windows.php.net/qa</a><br />
<br />
Please test the release carefully and report any bugs.<br />
<br />
We are now RC, this means stability only.<br />
Next RC is expected for May 23h.<br />
<br />
Thanks you all contributors.<br />
<br />
Regards<br />
  Julien and David]]></description>
            <dc:creator>Julien Pauli</dc:creator>
            <category>php-internals</category>
            <pubDate>Thu, 09 May 2013 11:00:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,702790,702790#msg-702790</guid>
            <title>[PHP-DEV] [PATCH] faster and safer fpm config reading (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,702790,702790#msg-702790</link>
            <description><![CDATA[ commit edae18ccf5c51ae0bcc0e9655ead7540fd42dd9f<br />
Author: Martin Pelikan &lt;pelikan@storkhole.cz&gt;<br />
Date:   Wed May 8 02:06:09 2013 +0200<br />
<br />
    Faster and safer parsing of fpm configuration.<br />
    <br />
    The current fpm config parser did a read(2) syscall per character,<br />
    which obfuscated debugging strace/ktrace output somewhat.  This also<br />
    makes the 1024 characters per line limit more explicit, so the users<br />
    will know what were they hitting.<br />
    <br />
    It might improve performance during php-fpm load (.03 vs .00 seconds<br />
    on my laptop) but primarily serves to help observing fpm system call<br />
    traces during deployment (in chroot for example).<br />
    <br />
    Signed-off-by: Martin Pelikan &lt;martin.pelikan@gmail.com&gt;<br />
<br />
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c<br />
index 0a8a0e3..e004934 100644<br />
--- a/sapi/fpm/fpm/fpm_conf.c<br />
+++ b/sapi/fpm/fpm/fpm_conf.c<br />
@@ -1447,11 +1447,11 @@ static void fpm_conf_ini_parser(zval *arg1, zval *arg2, zval *arg3, int callback<br />
 <br />
 int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */<br />
 {<br />
+	const int bufsize = 1024;<br />
 	int error = 0;<br />
-	char buf[1024+1];<br />
-	int fd, n;<br />
+	char buf[bufsize], *newl;<br />
+	int fd, pos = 0;<br />
 	int nb_read = 1;<br />
-	char c = '*';<br />
 <br />
 	int ret = 1;<br />
 <br />
@@ -1473,36 +1473,48 @@ int fpm_conf_load_ini_file(char *filename TSRMLS_DC) /* {{{ */<br />
 	}<br />
 <br />
 	ini_lineno = 0;<br />
+	memset(buf, 0, sizeof buf);<br />
 	while (nb_read &gt; 0) {<br />
 		int tmp;<br />
-		memset(buf, 0, sizeof(char) * (1024 + 1));<br />
-		for (n = 0; n &lt; 1024 &amp;&amp; (nb_read = read(fd, &amp;c, sizeof(char))) == sizeof(char) &amp;&amp; c != '\n'; n++) {<br />
-			buf[n] = c;<br />
-		}<br />
-		buf[n++] = '\n';<br />
-		ini_lineno++;<br />
-		ini_filename = filename;<br />
-		tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &amp;error TSRMLS_CC);<br />
-		ini_filename = filename;<br />
-		if (error || tmp == FAILURE) {<br />
-			if (ini_include) free(ini_include);<br />
-			ini_recursion--;<br />
-			close(fd);<br />
-			return -1;<br />
-		}<br />
-		if (ini_include) {<br />
-			char *tmp = ini_include;<br />
-			ini_include = NULL;<br />
-			fpm_evaluate_full_path(&amp;tmp, NULL, NULL, 0);<br />
-			fpm_conf_ini_parser_include(tmp, &amp;error TSRMLS_CC);<br />
-			if (error) {<br />
-				free(tmp);<br />
+<br />
+		nb_read = read(fd, buf + pos, sizeof buf - pos);<br />
+		pos = 0;<br />
+		<br />
+		while ((newl = strchr(buf + pos, '\n')) != NULL) {<br />
+			newl[0] = '\0';<br />
+			ini_lineno++;<br />
+			ini_filename = filename;<br />
+			tmp = zend_parse_ini_string(buf + pos, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t)fpm_conf_ini_parser, &amp;error TSRMLS_CC);<br />
+			ini_filename = filename;<br />
+			if (error || tmp == FAILURE) {<br />
+				if (ini_include) free(ini_include);<br />
 				ini_recursion--;<br />
 				close(fd);<br />
 				return -1;<br />
 			}<br />
-			free(tmp);<br />
+			if (ini_include) {<br />
+				char *tmp = ini_include;<br />
+				ini_include = NULL;<br />
+				fpm_evaluate_full_path(&amp;tmp, NULL, NULL, 0);<br />
+				fpm_conf_ini_parser_include(tmp, &amp;error TSRMLS_CC);<br />
+				if (error) {<br />
+					free(tmp);<br />
+					ini_recursion--;<br />
+					close(fd);<br />
+					return -1;<br />
+				}<br />
+				free(tmp);<br />
+			}<br />
+<br />
+			pos = newl - buf + 1;<br />
+		}<br />
+		if (nb_read &gt; 0 &amp;&amp; pos == 0) {<br />
+			zlog(ZLOG_ERROR, &quot;line %u too long&quot;, ini_lineno + 1);<br />
+			close(fd);<br />
+			return -1;<br />
 		}<br />
+		memmove(buf, buf + pos, sizeof buf - pos);<br />
+		pos = sizeof buf - pos;<br />
 	}<br />
 <br />
 	ini_recursion--;<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Martin Pelikan</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 08 May 2013 02:30:03 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,702551,702551#msg-702551</guid>
            <title>[PHP-DEV] idea: implement a Comparable interface (12 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,702551,702551#msg-702551</link>
            <description><![CDATA[ It'd be nice if, when doing $objA &gt; $objB, that that'd invoke<br />
$objA-&gt;__compareTo($objB) or something, much like Java's Comparable<br />
interface.]]></description>
            <dc:creator>Thomas Anderson</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 08 May 2013 08:40:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,702546,702546#msg-702546</guid>
            <title>[PHP-DEV] idea: letting the line number and file name be set via user_error (19 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,702546,702546#msg-702546</link>
            <description><![CDATA[ If you do user_error('whatever') it'll show, as the line number for that<br />
error, the line number on which that user_error() call is made.  It'd be<br />
nice if you could control the line number and file name that was displayed.<br />
eg.<br />
<br />
&lt;?php<br />
function test() {<br />
    user_error('whatever');<br />
}<br />
<br />
test();<br />
?&gt;<br />
<br />
That'll say &quot;Notice: whatever in ... on line 4&quot; (ie. the line that the<br />
user_error is on) instead of &quot;Notice: whatever in ... on line 7&quot; (ie. the<br />
line that the call to the test() function is made).<br />
<br />
If the displayed line numbers could be controlled by user_error then<br />
debug_backtrace could be used to get the desired line number / file name to<br />
display.]]></description>
            <dc:creator>Thomas Anderson</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 08 May 2013 01:10:07 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,700733,700733#msg-700733</guid>
            <title>[PHP-DEV] Adding a new mysqli::bind_value method (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,700733,700733#msg-700733</link>
            <description><![CDATA[ I propose to add, contrary to the mysqli::bind_param method which accepts parameters only by ref (and triggers a fatal error when passing non-ref variables or values), a mysqli::bind_value method which accepts the variables by value.<br />
<br />
There are a few problems when using bind_param which bind_value tries to solve:<br />
<br />
a) When you aren't binding in a small scope, you have to make attention to not reusing the variable before execute()'ing the mysqli_stmt instance.<br />
b) You have to pass values per reference, so that you cannot do for example in a function:<br />
          call_user_func_array([$stmt, &quot;bind_param&quot;], array_merge([str_repeat(&quot;s&quot;, func_num_args())], func_get_args()));<br />
     this would fail in a message you couldn't pass them by value (when you cannot write the function expecting references as variable for some reason). A workaround would be to array_walk the array and pass the variable by ref to a new array, which is not really handy.<br />
c) When you try to pass raw values instead of a reference, it results in a &quot;Fatal error:  Cannot pass parameter 2 by reference&quot;.   <br />
d) Executing $stmt-&gt;bind_param(&quot;s&quot;, $a?$b:$c); would result in a &quot;Strict Standards: Only variables should be passed by reference&quot;. Yeah, it's only a strict error, but I think it's best practice to code error free...<br />
<br />
For c) and d): Yes, you could assign the result / raw value to a variable and then pass it to the function, but this are only a variable more, a code line more and a fraction of a nanosecond more (microoptimization, I just wanted to say it).<br />
<br />
The PR for this request is at: <a href="https://github.com/php/php-src/pull/338" target="_blank"  rel="nofollow">https://github.com/php/php-src/pull/338</a><br />
<br />
Bob<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Bob Weinand</dc:creator>
            <category>php-internals</category>
            <pubDate>Sun, 05 May 2013 16:00:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,700608,700608#msg-700608</guid>
            <title>[PHP-DEV] Scalar Type Casting Magic Methods (7 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,700608,700608#msg-700608</link>
            <description><![CDATA[ Quick Observations : <br />
<br />
I had this issue ( <a href="http://stackoverflow.com/questions/16375331/increment-on-tostring" target="_blank"  rel="nofollow">http://stackoverflow.com/questions/16375331/increment-on-tostring</a> ) and it kept me thinking why no error was returned, then i stumble up this RFC :  <a href="https://wiki.php.net/rfc/object_cast_to_types" target="_blank"  rel="nofollow">https://wiki.php.net/rfc/object_cast_to_types</a><br />
<br />
The patch is basic , simple and working and it should be seriously considered in 5.5.  I want to  believe if <a href="https://github.com/php/php-src/pull/334" target="_blank"  rel="nofollow">https://github.com/php/php-src/pull/334</a> can make it to PHP 5.5 then we should give object_cast_to_types the same opportunity except they are string objections why it should not be so<br />
<br />
<br />
Thanks<br />
Oleku Konko ]]></description>
            <dc:creator>Oleku Konko</dc:creator>
            <category>php-internals</category>
            <pubDate>Mon, 13 May 2013 10:20:03 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,700601,700601#msg-700601</guid>
            <title>[PHP-DEV] Proposal: new implentation of JSON extension. (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,700601,700601#msg-700601</link>
            <description><![CDATA[ Raise again this discussion as no feedback on pecl ML.<br />
<br />
Trying to solve <a href="https://bugs.php.net/bug.php?id=63520" target="_blank"  rel="nofollow">https://bugs.php.net/bug.php?id=63520</a><br />
<br />
I start to work on a dropin alternative for current json extension in php.<br />
<br />
<br />
Current work:<br />
<a href="https://github.com/remicollet/pecl-json-c" target="_blank"  rel="nofollow">https://github.com/remicollet/pecl-json-c</a><br />
<br />
<br />
It is obviously to late for PHP 5.5, and need probably more feedback,<br />
more tests, and more work before a RFC for PHP 5.6 (or later).<br />
<br />
* json_encode : same code than php 5.5, no difference<br />
<br />
* json_decode : wrapper over json-c 0.11 library.<br />
<br />
Difference:<br />
- error code returned by the parser are different (so only<br />
PHP_JSON_ERROR_SYNTAX and PHP_JSON_ERROR_DEPTH are used)<br />
- number only parse as integer (no automatic cast to double)<br />
- loose of performance (but still acceptable, I think)<br />
<br />
New feature: as json-c is an incremental parser, a new class is<br />
available to allow incremental parsing (for large json encoded data)<br />
<br />
<br />
<br />
Proposal:<br />
<br />
1/	update existing pecl/json extension<br />
<br />
	- on pecl for older PHP 5.3 - 5.5<br />
	- on php-src in master / 5.6<br />
<br />
OR<br />
<br />
2/	new pecl/json-c extension<br />
<br />
	- PHP will keep the non free code<br />
<br />
<br />
Should I open a RFC ?<br />
<br />
<br />
Regards,<br />
Remi.<br />
<br />
<br />
P.S. I have tried to contact Omar, original author of this extension,<br />
without any success.<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Remi Collet</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 04 May 2013 17:30:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,700587,700587#msg-700587</guid>
            <title>[PHP-DEV] [RFC] Add a second argument to callback of preg_replace_callback (no replies)</title>
            <link>http://www.serverphorums.com/read.php?7,700587,700587#msg-700587</link>
            <description><![CDATA[ Hey:<br />
  I thought it is a minor change, so was not plan to make a RFC ..<br />
<br />
  but since there are some insistent objections, I think a RFC is better.<br />
<br />
  let's people vote for it.<br />
<br />
  here is the RFC: <a href="https://wiki.php.net/rfc/second_arg_to_preg_callback" target="_blank"  rel="nofollow">https://wiki.php.net/rfc/second_arg_to_preg_callback</a><br />
<br />
  and objections are also listed.<br />
<br />
thanks<br />
<br />
-- <br />
Laruence  Xinchen Hui<br />
<a href="http://www.laruence.com/" target="_blank"  rel="nofollow">http://www.laruence.com/</a>]]></description>
            <dc:creator>Laruence</dc:creator>
            <category>php-internals</category>
            <pubDate>Sat, 04 May 2013 16:00:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,700585,700585#msg-700585</guid>
            <title>[PHP-DEV] Multi-level Caching Fork of OPcache -- update (2 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,700585,700585#msg-700585</link>
            <description><![CDATA[ Please treat this email by way of request for feedback from the OPcache <br />
developers and anyone interested in influencing my next steps on my <br />
<a href="https://github.com/TerryE/opcache" target="_blank"  rel="nofollow">https://github.com/TerryE/opcache</a> fork of OPcache and specifically on <br />
the dev-filecache branch.  The most appropriate channel is probably <br />
<a href="https://github.com/TerryE/opcache/issues" target="_blank"  rel="nofollow">https://github.com/TerryE/opcache/issues</a> -- unless you think that the <br />
comments have wider applicability for either the PECL or DEV communities.<br />
<br />
My ultimate aim is to take this to a point where the OPcache developers <br />
feel sufficiently comfortable to consider merging a future version back <br />
into OPcache.  I have added some detailed project wiki pages documenting <br />
my scope and progress and in particular on <br />
<a href="https://github.com/TerryE/opcache/wiki/MLC-OPcache-details" target="_blank"  rel="nofollow">https://github.com/TerryE/opcache/wiki/MLC-OPcache-details</a> and a brief <br />
quote from the page:<br />
<br />
&gt; An indication of the potential performance benefits of OPcache CLI <br />
&gt; mode can be seen from a simple benchmark based on 100 executions of <br />
&gt; the MediaWiki runJobs.php maintenance batch script. This compiles some <br />
&gt; 44 PHP sources, comprising 45K lines and 1,312 Kbytes. The cached <br />
&gt; version reads a single runJobs.cache file of 1,013 Kbytes.<br />
&gt;<br />
&gt;  Time in mSec         Average  Stdev<br />
&gt;  Uncached Execution     179      7<br />
&gt;  Cached Execution        77      7<br />
&gt;  (Image Load Overhead)   18      3<br />
<br />
In other words for this script, the MLC cache is delivering an <br />
approximate 60% runtime saving.  Of course this is only a point test, <br />
and benefits will vary -- though I hope that switching to LZ4 <br />
compression will improve these figures further.  But even this one point <br />
challenges what seems to be a core PHP development dogma: &quot;there's no <br />
point in using a file cache, because it makes no material performance <br />
difference&quot;.   Even this build *does* deliver material benefits , and I <br />
suggest that there is merit in moving to including MLC cached modes to <br />
accelerate CLI and GCI SAPI modes using this or a similar approach.<br />
<br />
 From an internals -- rather than PECL -- viewpoint what this would mean <br />
is that non-cached incremental compile-and-go execution modes would now <br />
be the exception than the norm -- largely negating the disadvantages of <br />
any compile-intensive optimization options.<br />
<br />
So thank-you in anticipation for your feedback.  I will do my utmost to <br />
respond constructively to all comments. :-)<br />
Regards Terry Ellison<br />
<br />
PS.  Apologies in advance:  I am &quot;up country&quot; at my cottage on an Island <br />
in the north Aegean with the nearest Wifi some walk away, so my Internet <br />
access is limited at the moment, and I might take some time to respond.<br />
<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Terry Ellison</dc:creator>
            <category>php-internals</category>
            <pubDate>Wed, 08 May 2013 18:30:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?7,699777,699777#msg-699777</guid>
            <title>[PHP-DEV] A better error handling approach. (6 replies)</title>
            <link>http://www.serverphorums.com/read.php?7,699777,699777#msg-699777</link>
            <description><![CDATA[ PHP currently has two separate approaches to handling errors:<br />
- Errors<br />
- Exceptions<br />
<br />
Both have their issues.<br />
<br />
Using and responding to errors requires that the returned value (if<br />
there is one) perform double duty as both a potential valid response<br />
AND, in the case of error, a flag that something went wrong. It's easy<br />
to forget to check that a particular call succeeded and specifically<br />
handle the error. I find myself constantly revisiting the<br />
documentation to ensure I know the specific error flag for functions,<br />
and performing post-hoc analysis of error logs to make sure I didn't<br />
miss an error flag that I would be better served by handling in the<br />
standard flow of my app.<br />
<br />
Using and responding to exceptions is a heavy-handed approach, as any<br />
particular exception can bring the entire application down.<br />
Additionally, the process of raising and catching exceptions loses<br />
context of the error, often requiring many different subclasses of<br />
exceptions to maintain the error state. Issues arise when the language<br />
constructs for exceptions are liberally used in situations that are<br />
not truly &quot;exceptional,&quot; and where the the exception handling becomes<br />
a glorified goto.<br />
<br />
I've been programming in Go, and the ability to pass back multiple<br />
arguments, one of which is conventionally the error state, is<br />
wonderful. It's simple, clear, concise, and powerful. The code calling<br />
into the error-capable function knows the context and can handle<br />
errors appropriately according to the application requirements.<br />
<br />
In PHP, we could provide the ability to automatically pack up a<br />
comma-separated list of values as an array:<br />
<br />
return $var1, $var2;<br />
// returns [$var1, $var2];<br />
<br />
And, we could provide the ability to automatically unpack an array<br />
into separate variables:<br />
<br />
$var1, $var2 = myFunction();<br />
// same as list($var1, $var2) = myFunction();<br />
<br />
This functionality would allow us to embrace the convention that an<br />
error is passed back as one of the return values:<br />
<br />
$dbh, $err = db\connect();<br />
// check for error<br />
if ($err) {<br />
    // handle db connection error<br />
}<br />
// carry on normally<br />
$dbh-&gt;query(&quot;blah blah blah&quot;);<br />
<br />
The simplicity (just passing back values), clarity (the code to handle<br />
errors is proximal to the code that caused the error), and efficiency<br />
(not having to create bunches of exception subclasses to maintain<br />
context/information, and exceptions are expensive) of this approach is<br />
a beautiful thing. You can see an explanation of Go error handling<br />
here:<br />
<a href="http://blog.golang.org/2011/07/error-handling-and-go.html" target="_blank"  rel="nofollow">http://blog.golang.org/2011/07/error-handling-and-go.html</a><br />
<br />
Concern 1: Isn't this just saving a few keystrokes?<br />
<br />
Allowing developers to pass back an array and then access the members<br />
of the array isn't the same thing, and we're not just saving a few<br />
keystrokes if this is implemented. Providing this ability promotes<br />
usage and clarity, and I'm confident Go would not have gotten<br />
developers to follow this convention if the syntax didn't facilitate<br />
the approach. I now write my Python code to handle errors in this same<br />
manner, taking advantage of its ability to handle comma-separated<br />
lists as tuples (something I didn't know about until recently, I must<br />
confess):<br />
<a href="http://stackoverflow.com/questions/423710/return-more-than-one-value-from-a-function-in-python" target="_blank"  rel="nofollow">http://stackoverflow.com/questions/423710/return-more-than-one-value-from-a-function-in-python</a><br />
<br />
Concern 2: Why don't you just use Python or Go?<br />
<br />
I really like using PHP for web development.<br />
<br />
Concern 3: Are you saying we should get rid of errors and exceptions?<br />
<br />
To be clear, errors have their place (maybe an extension failed to<br />
load, or a warning about usage of undeclared vars, etc.), and so do<br />
exceptions (for events that are truly &quot;exceptional&quot;, that should cause<br />
a major revision to the branching/flow of the application and/or stop<br />
the application in its tracks if left unhandled.)<br />
<br />
Adam<br />
<br />
-- <br />
PHP Internals - PHP Runtime Development Mailing List<br />
To unsubscribe, visit: <a href="http://www.php.net/unsub.php" target="_blank"  rel="nofollow">http://www.php.net/unsub.php</a>]]></description>
            <dc:creator>Adam Jon Richardson</dc:creator>
            <category>php-internals</category>
            <pubDate>Fri, 03 May 2013 08:40:06 +0200</pubDate>
        </item>
    </channel>
</rss>
