Ticket #12 (closed task: fixed)

Opened 2 years ago

Last modified 10 months ago

Fatal error: Invalid opcode 99/4/1

Reported by: Vincent Assigned to: bart
Priority: critical Milestone: 1.0
Component: Website Version: 0.9.4
Keywords: Cc:

Description

Hello!

I get this fatal error: Fatal error: Invalid opcode 99/4/1. in /www/equideo/bucowlique/core/Tools.class.php on line 426

Tools.class.php :

case Anticowrps::BOOL : // <=== line 426

$cast = 'boolean'; return TRUE;

BOOL is a class constant (const BOOL =12) defined in Anticowrps class.

I hope that it will be useful for you Vincent

Change History

03/08/06 21:26:51 changed by bart

  • owner changed from somebody to bart.
  • status changed from new to assigned.

Which version are you using? I guess this is PHP 5.1 with eA 0.9.5-beta1. Please try http://snapshots.eaccelerator.net

03/08/06 21:45:41 changed by Vincent

I use the last snapshot, from March 7th.

03/08/06 21:55:23 changed by Vincent

More info : I use PHP 5.1.2. Thanks.

03/22/06 15:22:05 changed by hans

Can you please give the current snapshot from http://snapshots.eaccelerator.net/ a try? I think i may have solved this problem while fixing another "Invalid opcode 99/4/1" problem.

Thanks.

03/23/06 21:25:01 changed by cwood@pixsystem.com

I've experienced this same bug using eA 0.9.5-beta1 as well as the the latest snapshot, eaccelerator-svn200603211108. I'm running under Mac OS X 10.4.5 using Mark Liyanage's PHP 5.1.2 for Apache 1.3 package.

The fatal error is "Invalid opcode 99/4/1." and is triggered by a line of code that assigns a class constant to a local variable:

  $xml_output = XMLIO::encodedXMLFlag;

This class constant is assigned near the top of the class file, as follows:

  const encodedXMLFlag = "<!-- ** ENCODED-XML ** -->";

It appears that these issues are related to the class constants, used in my assignment and Vincent's case statement.

03/24/06 06:58:29 changed by Vincent

I just try the last svn snapshot and i'm still experiencing this bug. The fatal error has not changed.

03/28/06 11:13:30 changed by bart

I can't reproduce it with this piece of code:

<?php
    class XMLIO {
        const encodedXMLFlag = "<!-- ** ENCODED-XML ** -->";
    }

      $xml_output = XMLIO::encodedXMLFlag;
?>

03/28/06 22:27:59 changed by cwood

In my case, the class constant was referenced inside a class function like this:

<?php
class XMLIO {
	const encodedXMLFlag = "<!-- ** ENCODED-XML ** -->";

	public function check() {
		try {
			$xml_output = XMLIO::encodedXMLFlag;		
		} catch (Exception $e) {
			throw $e;
		}
	}
}

$xml_handler = new XMLIO();
$xml_handler->check();
?>

However, this example fails to produce the Invalid opcode 99/4/1 error. My actual code, which still triggers the problem, is far more complicated and utilizes a multi-file tiered class hierarchy.

I'll try and put together an example that will produce the error outside of my codebase. I already tried extending the above example using classes in the same, single test file but that didn't produce the error.

03/31/06 10:19:49 changed by anonymous

The sample code at the end of this thread might be useful:

http://sourceforge.net/forum/forum.php?thread_id=1453401&forum_id=416742

03/31/06 23:00:02 changed by cwood@pixsystem.com

I can confirm that this code snippet causes the Invalid opcode 99/4/1 error. It was copied from the sourceforge link above with minor edits to make it more compact.

<?php

class FOO {
   const BAR = 1;
}

while (TRUE) {
   switch (FOO::BAR)  # Fatal error: Invalid opcode 99/4/1. (Replacing FOO::BAR with 1 eliminates the error.)
   {
      case 1:
         break 2;  # without the '2', there is no error
   }
   break;
}
?>

In my codebase I'm not using multi-level breaking, but I am using a switch statement, a number of foreach loops, try blocks, as well as various levels of function calls. I'm still trying to produce a simple example like this that is more inline with my codebase, but so far my examples seem to always run fine. I'll keep trying, but hopefully this example will shed some light on things.

04/05/06 12:15:05 changed by bart

That last piece of code has been fixed a while ago. You can get snapshots from here: http://snapshots.eaccelerator.net

04/06/06 04:13:09 changed by Vincent

This code does not work :

<?php

class FOO {
   const BAR = 1;
}

while (TRUE) {
   switch (FOO::BAR)  # Fatal error: Invalid opcode 99/4/1. (Replacing FOO::BAR with 1 eliminates the error.)
   {
      case 1:
         continue 2;  # without the '2', there is no error
   }
   break;
}
?>

04/06/06 04:13:40 changed by Vincent

I just changed "break" to "continue".

04/06/06 18:53:07 changed by anonymous

  • status changed from assigned to closed.
  • resolution set to fixed.

This has been fixed in svn. Please try one of the latest snapshots at http://snapshots.eaccelerator.net/

Thanks for your report!

04/11/06 21:42:04 changed by cwood

While my code failed with some of the previous snapshots, it now works correctly with 0.9.5 beta 2. Thanks for the fix!

07/03/06 10:32:42 changed by anonymous

  • priority changed from major to trivial.
  • type changed from defect to task.
  • version set to 0.9.4.
  • component changed from eAccelerator to Documentation.
  • milestone set to 0.9.5.

10/04/07 02:23:54 changed by amog

Useful ticket, thank You! seduction