Bug #20333 [Com]: A return() in an include won't skip registering classes below

From: Date: Mon, 04 Dec 2017 12:52:50 +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-212898@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: spam2 at rhsoft dot net 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: 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 Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2017-12-04 11:50:26] phpdoc at mail dot my1 dot info May I ask WHY this is not a bug? I looked around in the documentation and cannot find any explanation on why this is valid behavior. ------------------------------------------------------------------------ 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

« previous php.bugs (#212898) next »