3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Loader { function register() { eval(<<<EOPHP namespace App; function strlen(\$str) { return 20; } EOPHP ); } } namespace App { function run($str) { echo __NAMESPACE__, PHP_EOL; echo strlen($str), PHP_EOL; } run("foo"); \Loader\register(); run("bar"); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0PbCO
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   INIT_NS_FCALL_BY_NAME                                        'App%5Crun'
          1        SEND_VAL_EX                                                  'foo'
          2        DO_FCALL                                          0          
   21     3        INIT_FCALL                                                   'loader%5Cregister'
          4        DO_FCALL                                          0          
   22     5        INIT_NS_FCALL_BY_NAME                                        'App%5Crun'
          6        SEND_VAL_EX                                                  'bar'
          7        DO_FCALL                                          0          
   23     8      > RETURN                                                       1

Function loader%5Cregister:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0PbCO
function name:  Loader\register
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INCLUDE_OR_EVAL                                              'namespace+App%3B%0Afunction+strlen%28%24str%29+%7B+return+20%3B+%7D', EVAL
   11     1      > RETURN                                                       null

End of function loader%5Cregister

Function app%5Crun:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0PbCO
function name:  App\run
number of ops:  11
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV                                                 !0      
   16     1        ECHO                                                         'App'
          2        FETCH_CONSTANT                                       ~1      'App%5CPHP_EOL'
          3        ECHO                                                         ~1
   17     4        INIT_NS_FCALL_BY_NAME                                        'App%5Cstrlen'
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $2      
          7        ECHO                                                         $2
          8        FETCH_CONSTANT                                       ~3      'App%5CPHP_EOL'
          9        ECHO                                                         ~3
   18    10      > RETURN                                                       null

End of function app%5Crun

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.17 ms | 489 KiB | 13 Q