# Backporting to 5_3

- Thread: https://externals.io/message/36536
- Original archive: https://news-web.php.net/php.internals/36536
- Started by Felipe Pena on 2008-03-26T13:04:46+00:00
- Messages: 31
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/36536.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #36536 — Felipe Pena — 2008-03-26T13:04:46+00:00

URL: https://externals.io/message/36536#36536

Hello,

I would like know which itens below needs be backported to 5_3:

- Added runtime JIT auto-globals fetching and caching. (Dmitry, Sara)
- Added "jump label" operator (limited "goto"). (Dmitry, Sara)
- Removed support for "continue" and "break" operators with non-constant
  operands. (Dmitry)
- Removed undocumented and incomplete support for strings in list()
operator. (Dmitry)
- Changed "instanceof" and "catch" operators, `is_a()` and
 `is_subclass_of()` functions to not call __autoload(). (Dmitry)

Let me know, and then i could post the patch for aprovation.

PS: If is whished be backported a item in NEWS file that i not
mentioned, let know too. :)

-- 
Regards,
Felipe Pena.

---

## #36538 — Jani Taskinen — 2008-03-26T13:41:56+00:00

URL: https://externals.io/message/36536#36538 · In reply to: #36536

All.

--Jani



> Hello,
> 
> I would like know which itens below needs be backported to 5_3:
> 
> - Added runtime JIT auto-globals fetching and caching. (Dmitry, Sara)
> - Added "jump label" operator (limited "goto"). (Dmitry, Sara)
> - Removed support for "continue" and "break" operators with non-constant
>   operands. (Dmitry)
> - Removed undocumented and incomplete support for strings in list()
> operator. (Dmitry)
> - Changed "instanceof" and "catch" operators, `is_a()` and
> `is_subclass_of()` functions to not call __autoload(). (Dmitry)
> 
> Let me know, and then i could post the patch for aprovation.
> 
> PS: If is whished be backported a item in NEWS file that i not
> mentioned, let know too. :)
> 
> -- 
> Regards,
> Felipe Pena.
> 
> 
-- 
Patches/Donations: http://pecl.php.net/~jani/

---

## #36540 — Stanislav Malyshev — 2008-03-26T16:39:28+00:00

URL: https://externals.io/message/36536#36540 · In reply to: #36536

Hi!

> - Added runtime JIT auto-globals fetching and caching. (Dmitry, Sara)

Does this change any semantics, etc? Any reason why it wasn't merged in 
the first place?

> - Added "jump label" operator (limited "goto"). (Dmitry, Sara)

No strong opinion here, I didn't need it anyway :)

> - Removed support for "continue" and "break" operators with non-constant
>   operands. (Dmitry)

I'd wait for 6 with this. May break some scripts.

> - Removed undocumented and incomplete support for strings in list()
> operator. (Dmitry)

Not sure here. What code does it break?

> - Changed "instanceof" and "catch" operators, `is_a()` and
> `is_subclass_of()` functions to not call __autoload(). (Dmitry)

This definitely should be - there's absolutely no reason any kind on 
instanceof-like operator would call autoload.

-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36548 — Cristian Rodriguez — 2008-03-26T16:55:36+00:00

URL: https://externals.io/message/36536#36548 · In reply to: #36540

2008/3/26, Stanislav Malyshev <stas@zend.com>:

> > […]
>
>
> I'd wait for 6 with this. May break some scripts.

I dont think it will break more a piece of code that doesnt really work. ;)

-- 
"If debugging is the process of removing bugs, then programming must
be the process of putting them in." – Edsger Dijkstra

http://www.cristianrodriguez.net

---

## #36550 — Pierre Joye — 2008-03-26T16:56:48+00:00

URL: https://externals.io/message/36536#36550 · In reply to: #36540

> Hi!
>
>
> > […]
>
>  Does this change any semantics, etc? Any reason why it wasn't merged in
>  the first place?

It was initially done for the input encoding in head as the runtime
encoding may change after RINIT and inside the script.
By the way, the JIT fetch&de/encode part is still to be done in HEAD.

-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36552 — Stanislav Malyshev — 2008-03-26T17:13:17+00:00

URL: https://externals.io/message/36536#36552 · In reply to: #36548

> > […]
> 
> I dont think it will break more a piece of code that doesnt really work. ;)

Af far as I know, breaks with arguments do work in PHP.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36554 — Hannes Magnusson — 2008-03-26T18:02:42+00:00

URL: https://externals.io/message/36536#36554 · In reply to: #36552

> > […]
>
>  Af far as I know, breaks with arguments do work in PHP.

<?php
$foo = 2;
while(true) {
	while(true) {
		echo "Hello world!\n";
		if (true) {
			break $foo;
		}
	}
	echo "Never reached\n";
}

This is what was removed. not normal "break 2;"

-Hannes

---

## #36575 — Markus Fischer — 2008-03-26T20:50:57+00:00

URL: https://externals.io/message/36536#36575 · In reply to: #36554

Hi,

Hannes Magnusson wrote:
> <?php
> $foo = 2;
> while(true) {
> 	while(true) {
> 		echo "Hello world!\n";
> 		if (true) {
> 			break $foo;
> 		}
> 	}
> 	echo "Never reached\n";
> }
> 
> This is what was removed. not normal "break 2;"

According to Google Code Search ( 
http://www.google.com/codesearch?q=lang%3Aphp+break\s%2B\%24&hl=en&btnG=Search+Code 
) there are only two distinct pieces of code out there using dynamic break:

"never heard of" XPath.class.php and "also never heard of" some code deep 
inside this Xayara CMS.

Although it seems XPath.class.php is used by some projects (phpmyadmin, 
phpgroupware, falbum, lifetype) I checked phpmyadmin and at least in 2.9.1 
this class is not included anymore. 	

On the other hand, dynamic continie only seems to be used in PhpDocumentor:
http://www.google.com/codesearch?hl=en&lr=&q=lang%3Aphp+continue\s%2B\%24&btnG=Search

Havent't checked if that one is still used.

- Markus

---

## #36578 — Stanislav Malyshev — 2008-03-26T21:05:14+00:00

URL: https://externals.io/message/36536#36578 · In reply to: #36575

Hi!

> > […]

As I understand, this code works now.

> "never heard of" XPath.class.php and "also never heard of" some code 
> deep inside this Xayara CMS.

And used by people. Did I or anybody here on the list actually contacted 
with these people or not does not matter - we can't contact millions of 
PHP users anyway.
So I think the removal might be held for PHP 6.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36580 — Lukas Kahwe Smith — 2008-03-26T21:16:38+00:00

URL: https://externals.io/message/36536#36580 · In reply to: #36578

>
> > […]
>
> And used by people. Did I or anybody here on the list actually  
> contacted with these people or not does not matter - we can't  
> contact millions of PHP users anyway.
> So I think the removal might be held for PHP 6.
>

yeah .. lets keep this kind of cleanup for php6

regards,
Lukas

---

## #36587 — Felipe Pena — 2008-03-26T23:30:00+00:00

URL: https://externals.io/message/36536#36587 · In reply to: #36540

2008/3/26, Stanislav Malyshev <stas@zend.com>:
> > […]
>
>
> This definitely should be - there's absolutely no reason any kind on
>  instanceof-like operator would call autoload.

Hehe, curious... See above.

+    * (PHP_5_1)
+      NEWS
+      ZendEngine2/zend_builtin_functions.c
+      ZendEngine2/zend_compile.c
+      ZendEngine2/zend_compile.h
+      ZendEngine2/zend_execute.h
+      ZendEngine2/zend_execute_API.c
+      ZendEngine2/tests/catch.phpt
+      ZendEngine2/tests/instanceof.phpt
+      ZendEngine2/tests/is_a.phpt:
+      Changed "instanceof" and "catch" operators, `is_a()` and `is_subclass_of()`
+      functions to not call __autoload().

This was done a long time! :D (and is documented about the instanceof)

---

## #36589 — johannes@php.net — 2008-03-26T23:34:32+00:00

URL: https://externals.io/message/36536#36589 · In reply to: #36536

> Hello,
> 
> I would like know which itens below needs be backported to 5_3:
> 
> - Added runtime JIT auto-globals fetching and caching. (Dmitry, Sara)

Not sure if this has benefits without the encoding stuff which is
planned for PHP 6.

> - Added "jump label" operator (limited "goto"). (Dmitry, Sara)

No objection, while it adds yet another keyword.

> - Removed support for "continue" and "break" operators with non-constant
>   operands. (Dmitry)

-1, also just two use cases were found I don't like to break that with
5.3.

> - Removed undocumented and incomplete support for strings in list()
> operator. (Dmitry)

What exactly does that change?

> - Changed "instanceof" and "catch" operators, `is_a()` and
> `is_subclass_of()` functions to not call __autoload(). (Dmitry)

+1, makes sense.


> Let me know, and then i could post the patch for aprovation.

Please do that.

Thanks,
johannes

---

## #36594 — Pierre Joye — 2008-03-26T23:48:24+00:00

URL: https://externals.io/message/36536#36594 · In reply to: #36589

>
>  
>
> > […]
>
>  Not sure if this has benefits without the encoding stuff which is
>  planned for PHP 6.

If the JIT is actually enabled by default (as far as I remember it is
not), it can be useful as a request will simply not process any JIT
data if it is not actually used. The current behavior now is to do a
compile time JIT (detection of possible GPCES usage). The encoding is
useless in 5.3 without unicode support, it is binary as we know it ;)

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36595 — johannes@php.net — 2008-03-26T23:54:16+00:00

URL: https://externals.io/message/36536#36595 · In reply to: #36594

> 
> > […]
> 
> If the JIT is actually enabled by default (as far as I remember it is
> not), it can be useful as a request will simply not process any JIT
> data if it is not actually used. The current behavior now is to do a
> compile time JIT (detection of possible GPCES usage). The encoding is
> useless in 5.3 without unicode support, it is binary as we know it ;)

And compile time JIT is fine as long as we don't have to care for
encoding, right? So this change won't be needed in 5.3.

johannes

---

## #36596 — Pierre Joye — 2008-03-27T00:01:45+00:00

URL: https://externals.io/message/36536#36596 · In reply to: #36595

>

>  And compile time JIT is fine as long as we don't have to care for
>  encoding, right? So this change won't be needed in 5.3.

Except when one sends a xxMB post that you are not expecting and will
not use. But that has been so for years, too bad though, 5.3 is the
perfect time for such thing.


-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36597 — johannes@php.net — 2008-03-27T00:05:30+00:00

URL: https://externals.io/message/36536#36597 · In reply to: #36596

> 
> > […]
> 
> > […]
> 
> Except when one sends a xxMB post that you are not expecting and will
> not use. But that has been so for years, too bad though, 5.3 is the
> perfect time for such thing.

which is handled by post_max_filesize and as long as we don't add error
handling it doesn't make a difference if that happens at compile- or
runtime.

johannes

---

## #36598 — Pierre Joye — 2008-03-27T00:35:45+00:00

URL: https://externals.io/message/36536#36598 · In reply to: #36597

>
>  
> > […]
>
>  which is handled by post_max_filesize and as long as we don't add error
>  handling it doesn't make a difference if that happens at compile- or
>  runtime.

Indeed it makes a difference. In one case it is always initialized, in
the other only if it is actually used (and not only if  a
_GET/_POST... exists in the script). That's a pretty big difference.

-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #36599 — Richard Lynch — 2008-03-27T00:59:47+00:00

URL: https://externals.io/message/36536#36599 · In reply to: #36552

> > […]
>
> Af far as I know, breaks with arguments do work in PHP.

And I even used it once...

I could re-factor to work around it in minutes, but there it is...

Just one data-point.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

---

## #36601 — Felipe Pena — 2008-03-27T02:22:28+00:00

URL: https://externals.io/message/36536#36601 · In reply to: #36589

2008/3/26, Johannes Schlüter <johannes@php.net>:
> > […]
>
>
> No objection, while it adds yet another keyword.
>

Patch:
- http://felipe.ath.cx/diff/goto.diff

Patch full (with re2c regenerated files):
- http://felipe.ath.cx/diff/goto-with-re2c.diff

---

## #36602 — Felipe Pena — 2008-03-27T02:43:57+00:00

URL: https://externals.io/message/36536#36602 · In reply to: #36589

2008/3/26, Johannes Schlüter <johannes@php.net>:
> > […]
>
>
> What exactly does that change?

$a = "foo"; list($b) = $a; var_dump($b);

Before:
string(1) "f"

After (HEAD):
NULL

---

## #36610 — Lukas Kahwe Smith — 2008-03-27T10:13:34+00:00

URL: https://externals.io/message/36536#36610 · In reply to: #36550

> On Wed, Mar 26, 2008 at 5:39 PM, Stanislav Malyshev <stas@zend.com>  
> wrote:
> > […]
>
> It was initially done for the input encoding in head as the runtime
> encoding may change after RINIT and inside the script.
> By the way, the JIT fetch&de/encode part is still to be done in HEAD.

I have added this to the php60 todo list. hope you dont mind that i  
put your name behind this item. at the very least you would know what  
to do if someone wants to take on this item.

regards,
Lukas

---

## #36628 — Felipe Pena — 2008-03-27T22:21:04+00:00

URL: https://externals.io/message/36536#36628 · In reply to: #36602

Em Qua, 2008-03-26 às 23:43 -0300, Felipe Pena escreveu:
> 2008/3/26, Johannes Schlüter <johannes@php.net>:
> > […]
> 
> $a = "foo"; list($b) = $a; var_dump($b);
> 
> Before:
> string(1) "f"
> 
> After (HEAD):
> `NULL` 

Hmm, is that being used anywhere at the planet? :D

Anyway...

Patch: http://felipe.ath.cx/diff/list.diff

-- 
Regards,
Felipe Pena.

---

## #36629 — Stanislav Malyshev — 2008-03-27T22:31:54+00:00

URL: https://externals.io/message/36536#36629 · In reply to: #36602

> > […]
> 
> $a = "foo"; list($b) = $a; var_dump($b);

This is weird... I wouldn't go as far as saying nobody uses it - since 
experience shows there's somebody somewhere using any weird combination 
of PHP features imaginable - but it's definitely a strange code. Even 
though, I think since it's functionality drop, we may want to wait with 
it, unless it doesn't work anyway (e.g. produces segfaults in some cases).

-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #36641 — Hannes Magnusson — 2008-03-28T11:58:12+00:00

URL: https://externals.io/message/36536#36641 · In reply to: #36601

> 2008/3/26, Johannes Schlüter <johannes@php.net>:
>
> > […]
>
>  Patch:
>  - http://felipe.ath.cx/diff/goto.diff
>
>  Patch full (with re2c regenerated files):
>  - http://felipe.ath.cx/diff/goto-with-re2c.diff

This should definitely go into 5_3, please commit.

-Hannes

---

## #36642 — Hannes Magnusson — 2008-03-28T12:00:54+00:00

URL: https://externals.io/message/36536#36642 · In reply to: #36629

> > […]
>
>  This is weird... I wouldn't go as far as saying nobody uses it - since
>  experience shows there's somebody somewhere using any weird combination
>  of PHP features imaginable - but it's definitely a strange code. Even
>  though, I think since it's functionality drop, we may want to wait with
>  it, unless it doesn't work anyway (e.g. produces segfaults in some cases).

I agree.
Any functionality removal, no matter how wtf it might be, shouldn't be merged.
If we could however throw `E_DEPRECATED` there, that would be great.

-Hannes

---

Next page: https://externals.io/message/36536.md?page=2
