3v4l.org

run code in 500+ PHP versions simultaneously
<?php $foo = <<<PHP \$LOST_VARIABLE = 42; class Foo { public function foo() { // throw notice about deprecated constructor } } PHP; set_error_handler(function($errno, $errstr) { throw new Exception($errstr, $errno); // convert error to exception }); try { eval($foo); } catch (Exception $e) { printf("error %d with message: %s\n", $e->getCode(), $e->getMessage()); } var_dump( class_exists('foo'), // exists! isset($LOST_VARIABLE) // where is my variable );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oQlFm
function name:  (null)
number of ops:  24
compiled vars:  !0 = $foo, !1 = $e, !2 = $LOST_VARIABLE
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%24LOST_VARIABLE+%3D+42%3B%0A%0Aclass+Foo+%7B%0A+++public+function+foo%28%29+%7B%0A++++++%2F%2F+throw+notice+about+deprecated+constructor%0A+++%7D%0A%7D'
   13     1        INIT_FCALL                                                   'set_error_handler'
          2        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
   15     3        SEND_VAL                                                     ~4
   13     4        DO_ICALL                                                     
   18     5        INCLUDE_OR_EVAL                                              !0, EVAL
          6      > JMP                                                          ->17
   19     7  E > > CATCH                                           last         'Exception'
   20     8    >   INIT_FCALL                                                   'printf'
          9        SEND_VAL                                                     'error+%25d+with+message%3A+%25s%0A'
         10        INIT_METHOD_CALL                                             !1, 'getCode'
         11        DO_FCALL                                          0  $7      
         12        SEND_VAR                                                     $7
         13        INIT_METHOD_CALL                                             !1, 'getMessage'
         14        DO_FCALL                                          0  $8      
         15        SEND_VAR                                                     $8
         16        DO_ICALL                                                     
   23    17    >   INIT_FCALL                                                   'var_dump'
   24    18        FRAMELESS_ICALL_1                class_exists        ~10     'foo'
         19        SEND_VAL                                                     ~10
   25    20        ISSET_ISEMPTY_CV                                     ~11     !2
         21        SEND_VAL                                                     ~11
   23    22        DO_ICALL                                                     
   26    23      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/oQlFm
function name:  {closure:/in/oQlFm:13}
number of ops:  8
compiled vars:  !0 = $errno, !1 = $errstr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   14     2        NEW                                                  $2      'Exception'
          3        SEND_VAR_EX                                                  !1
          4        SEND_VAR_EX                                                  !0
          5        DO_FCALL                                          0          
          6      > THROW                                             0          $2
   15     7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.17 ms | 2709 KiB | 16 Q