php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36229 Adding arbitary expression to class cause premature end to script
Submitted: 2006-01-31 15:27 UTC Modified: 2006-02-01 09:21 UTC
From: perry dot sebastian at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.1 OS: linux - SUSE 10
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: perry dot sebastian at gmail dot com
New email:
PHP Version: OS:

 

 [2006-01-31 15:27 UTC] perry dot sebastian at gmail dot com
Description:
------------
Adding a line of code to a specific object class causes the web application to terminate prematurely. A line of code such as "function testthis() {}" will trigger this problem. When this line is commented out, the application behaves as expected.
Code previously worked under PHP 4.4. 

Reproduce code:
---------------
<?php
// class DataCon is data container
class DataCon {
    //defined variables

    function __construct() {}

    function init( $args, &$dbh ) {
       // init object
    }

    // various functions for getting and setting data

# multiple
# lines of code
# commented out

}
?> 

Expected result:
----------------
Web page with printed output of application states at the top of the page.

Actual result:
--------------
This problem seems to be isolated with this class file. I have turned on STRICT for error reporting, but no error relevant to this object comes back when the application is executed. I cleaned line endings, changed function names, removed and added code, and the problem persists. Apache does not report an error.
Premature termination is also very strange. It seems very inconsistent. Initially an error occurred that flagged an included file for consuming too much memory. This error stopped after the error was investigated (and I have not been able to replicate this error). The failure appears to "reach back" in the code execution and stop application output before the point of failure (noted by various print statement track code execution). Forcing an exit of the application before loading this object class causes termination at the appropriate point - not before.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-31 15:44 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


I don't see any problems with this code.
 [2006-02-01 04:25 UTC] perry dot sebastian at gmail dot com
I don't any problems with the code, either...

I installed 5.1.2 (the bug report should have indicated a version number of 5.1.1). And now the following fatal error is being reported:

[debug info] -> size patterns[77], replacements[77] pagedata[13089]

Fatal error: Allowed memory size of 8388608 bytes exhausted at /opt/php/php-5.1.2/ext/pcre/php_pcre.c:880 (tried to allocate 26179 bytes) in /srv/www/lampair/lib/PageMaker.php on line 578

Line 577 - 578 in PageMaker.php are:

577: if($carplinks) { print "size patterns[".count($patterns)."], replacements[".count($replacements)."] pagedata[".strlen($pagedata)."]<br>\n"; }
578: $pagedata = preg_replace($patterns, $replacements, $pagedata);

This fatal error with preg_replace was not reported under 5.1.1, so it would seem likely that the failure to complete the output of the page under 5.1.1 was related to the same error.
 [2006-02-01 09:21 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 10:01:32 2025 UTC