3v4l.org

run code in 300+ PHP versions simultaneously
<?php //declare(strict_types = 1); function hello(string $s) : void { echo "$s\n"; } function fourtyTwo() : int { // returning wrong type return "42"; } // calling with wrong type try { hello(1234); } catch (Throwable $t) { echo $t; } try { echo fourtyTwo(); } catch (Throwable $t) { echo $t; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 4
Branch analysis from position: 4
2 jumps found. (Code = 107) Position 1 = 5, Position 2 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DtAef
function name:  (null)
number of ops:  13
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'hello'
          1        SEND_VAL                                                 1234
          2        DO_FCALL                                      0          
          3      > JMP                                                      ->6
   16     4  E > > CATCH                                       last         'Throwable'
   17     5    >   ECHO                                                     !0
   21     6    >   INIT_FCALL                                               'fourtytwo'
          7        DO_FCALL                                      0  $2      
          8        ECHO                                                     $2
          9      > JMP                                                      ->12
   22    10  E > > CATCH                                       last         'Throwable'
   23    11    >   ECHO                                                     !0
   24    12    > > RETURN                                                   1

Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DtAef
function name:  hello
number of ops:  5
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      !0, '%0A'
          3        ECHO                                                     ~1
    6     4      > RETURN                                                   null

End of function hello

Function fourtytwo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DtAef
function name:  fourtyTwo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   VERIFY_RETURN_TYPE                               ~0      '42'
          1      > RETURN                                                   ~0
   11     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function fourtytwo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.05 ms | 1399 KiB | 15 Q