Bug #20333 [Com]: A return() in an include won't skip registering classes below
| From: | phpdoc at mail dot my1 dot info | Date: | Mon, 04 Dec 2017 13:01:20 +0000 |
| Subject: | Bug #20333 [Com]: A return() in an include won't skip registering classes below | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212899@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=20333&edit=1
ID: 20333
Comment by: phpdoc at mail dot my1 dot info
Reported by: mgv at fx dot ro
Summary: A return() in an include won't skip registering
classes below
Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: Linux
PHP Version: 4.2.3
Block user comment: N
Private report: N
New Comment:
but when a class is put inside an if-statement it doesnt load the class, even though no matter
whether you use an if/else statement to stop the code or a return normally the results should be the
same.
Previous Comments:
------------------------------------------------------------------------
[2017-12-04 12:52:48] spam2 at rhsoft dot net
jesus that is a default paragrpah at clsoing bugreports which are not bugs and should go to whatever
discussion forum - common sense - how do you expect PHP work with a class when it's not
registered at compile time?
PHP is a *compiled language* for many years now
https://de.slideshare.net/jpauli/quick-tour-of-php-from-inside
------------------------------------------------------------------------
[2017-12-04 12:45:32] phpdoc at mail dot my1 dot info
also the reporter of this bug was directed to the manual, but WHERE is this behavior described. I
checked the main page about classes (pretty much where that should be) but I didnt find it in the
page's text.
------------------------------------------------------------------------
[2017-12-04 12:45:19] spam2 at rhsoft dot net
> sorry if I dont really understand too much of what happens low level
> but that's specifically why I ask on why this happens
you confuse a *bugtracker* with stackoverflow
------------------------------------------------------------------------
[2017-12-04 12:41:35] phpdoc at mail dot my1 dot info
but why does compiling the PHP file make the class available even though it shouldnt be yet?
code that is not a class gets stopped properly so why not the class itself?
sorry if I dont really understand too much of what happens low level but that's specifically
why I ask on why this happens.
------------------------------------------------------------------------
[2017-12-04 11:57:33] spam2 at rhsoft dot net
because PHP is not just a naive scripting language like bash where you can get in trouble when you
edit a still running file - PHP *compiles* scripts and with opcache which is pretty standard these
days even stores the so compiled bytecode
WHY?
* beause performance would suck otherwise
* because you would face errors only at runtime
* because it's natural to optimize programming languages
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=20333
--
Edit this bug report at https://bugs.php.net/bug.php?id=20333&edit=1