3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const Bar = 123; static $Bar = 456; } function tryEval(string $code) { $foo = new Foo; try { eval($code); } catch(Throwable $e) { echo $e, "\n"; } echo "\n"; } tryEval('echo "{$foo::$Bar}\n";'); tryEval('echo "{$foo::Bar}\n";'); tryEval('echo "{$foo::class}\n";');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTnNv
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'tryeval'
          1        SEND_VAL                                                 'echo+%22%7B%24foo%3A%3A%24Bar%7D%5Cn%22%3B'
          2        DO_FCALL                                      0          
   19     3        INIT_FCALL                                               'tryeval'
          4        SEND_VAL                                                 'echo+%22%7B%24foo%3A%3ABar%7D%5Cn%22%3B'
          5        DO_FCALL                                      0          
   20     6        INIT_FCALL                                               'tryeval'
          7        SEND_VAL                                                 'echo+%22%7B%24foo%3A%3Aclass%7D%5Cn%22%3B'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function tryeval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTnNv
function name:  tryEval
number of ops:  11
compiled vars:  !0 = $code, !1 = $foo, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        NEW                                              $3      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   11     4        INCLUDE_OR_EVAL                                          !0, EVAL
          5      > JMP                                                      ->9
   12     6  E > > CATCH                                       last         'Throwable'
   13     7    >   ECHO                                                     !2
          8        ECHO                                                     '%0A'
   15     9    >   ECHO                                                     '%0A'
   16    10      > RETURN                                                   null

End of function tryeval

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.77 ms | 1002 KiB | 16 Q