Hi! > Though obv, in reality we wouldn't use runkit_constant_add(), it'd be a > new opcode which had the same effect. This is basically transparent to > opcode caches, allows the constant to actually change based on runtime
If the class definition can actually change at runtime, I think it'd make it much harder for opcode caches since they can't any longer assume class definition can't change at any random place in the code. But this is not the most tricky part. The most tricky part is this: if(true) return; class Foo { const halfpie = M_PI/2; } Now what happens if this is implemented as an opcode? We can't run any opcodes past return statement, but Foo is expected to be defined here. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php