3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "start\n"; register_shutdown_function(function() { $err = error_get_last(); if ($err) { echo "Yes error_get_last\n"; echo "Error is: ".print_r($err, True); } else { echo "No error_get_last\n"; } echo "shutdown\n"; }); set_exception_handler(function($ex) { if ($ex instanceof Error) { echo "Exception Handler is Error\n"; return Null; } echo "Exception Handler\n"; die(); }); set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) { echo "Error Handler: ".$errstr."\n"; echo "Error Type: ".$errno."\n"; die(); #throw new ErrorException("raising errorexception", 0, $errno, $errfile, $errline); }); class Foo { public function __construct($ii) { $this->internal = $ii; } public function foo1() { if ($this->internal === 5) { echo "Called Foo->foo1()\n"; } } } $exists = new Foo(5); #$exists->foo1(); #$exists->doesnotexist(); #doesnotexist(); #$doesnotexist->alsodoesnotexist(); #Foo::foo1(); $x = $y + 5; #$file=fopen("welcome.txt","r"); #echo $foo . "appending<br />"; #$t = I_AM_NOT_DEFINED; # #trigger_error("Triggered Error", E_USER_ERROR); #password_hash("swordfish", PASSWORD_BCRYPT, array("salt"=>"sjienvidndiwnsosvknsfoiwnlnvsoi")); echo "Continuing execution\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XDHAF
function name:  (null)
number of ops:  21
compiled vars:  !0 = $exists, !1 = $x, !2 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'start%0A'
    5     1        INIT_FCALL                                               'register_shutdown_function'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXDHAF%3A5%240'
   14     3        SEND_VAL                                                 ~3
          4        DO_ICALL                                                 
   16     5        INIT_FCALL                                               'set_exception_handler'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXDHAF%3A16%241'
   23     7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   25     9        INIT_FCALL                                               'set_error_handler'
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FXDHAF%3A25%242'
   30    11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
   46    13        NEW                                              $9      'Foo'
         14        SEND_VAL_EX                                              5
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !0, $9
   53    17        ADD                                              ~12     !2, 5
         18        ASSIGN                                                   !1, ~12
   61    19        ECHO                                                     'Continuing+execution%0A'
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FXDHAF%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XDHAF
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $err
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'error_get_last'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    7     3      > JMPZ                                                     !0, ->12
    8     4    >   ECHO                                                     'Yes+error_get_last%0A'
    9     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $3      
          9        CONCAT                                           ~4      'Error+is%3A+', $3
         10        ECHO                                                     ~4
         11      > JMP                                                      ->13
   11    12    >   ECHO                                                     'No+error_get_last%0A'
   13    13    >   ECHO                                                     'shutdown%0A'
   14    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXDHAF%3A5%240

Function %00%7Bclosure%7D%2Fin%2FXDHAF%3A16%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/XDHAF
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INSTANCEOF                                               !0, 'Error'
          2      > JMPZ                                                     ~1, ->5
   18     3    >   ECHO                                                     'Exception+Handler+is+Error%0A'
   19     4      > RETURN                                                   null
   21     5    >   ECHO                                                     'Exception+Handler%0A'
   22     6      > EXIT                                                     
   23     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXDHAF%3A16%241

Function %00%7Bclosure%7D%2Fin%2FXDHAF%3A25%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/XDHAF
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $errcontext
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
   26     5        CONCAT                                           ~5      'Error+Handler%3A+', !1
          6        CONCAT                                           ~6      ~5, '%0A'
          7        ECHO                                                     ~6
   27     8        CONCAT                                           ~7      'Error+Type%3A+', !0
          9        CONCAT                                           ~8      ~7, '%0A'
         10        ECHO                                                     ~8
   28    11      > EXIT                                                     
   30    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FXDHAF%3A25%242

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XDHAF
function name:  __construct
number of ops:  4
compiled vars:  !0 = $ii
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   35     1        ASSIGN_OBJ                                               'internal'
          2        OP_DATA                                                  !0
   36     3      > RETURN                                                   null

End of function __construct

Function foo1:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/XDHAF
function name:  foo1
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   FETCH_OBJ_R                                      ~0      'internal'
          1        IS_IDENTICAL                                             ~0, 5
          2      > JMPZ                                                     ~1, ->4
   40     3    >   ECHO                                                     'Called+Foo-%3Efoo1%28%29%0A'
   42     4    > > RETURN                                                   null

End of function foo1

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.91 ms | 1396 KiB | 23 Q