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

From: Date: Mon, 04 Dec 2017 12:45:33 +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-212897@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: 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. Previous Comments: ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ [2002-11-10 05:11:55] derick@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ 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 (#212897) next »