3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar($param = NULL) { if (func_num_args() == 0) throw new Exception("Missing parameter"); var_dump($param); } } $foo = new Foo(); $foo->bar("hello"); $foo->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kn39
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              'hello'
          5        DO_FCALL                                      0          
   14     6        INIT_METHOD_CALL                                         !0, 'bar'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6Kn39
function name:  bar
number of ops:  12
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        FUNC_NUM_ARGS                                    ~1      
          2        IS_EQUAL                                                 ~1, 0
          3      > JMPZ                                                     ~2, ->8
    6     4    >   NEW                                              $3      'Exception'
          5        SEND_VAL_EX                                              'Missing+parameter'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
    8     8    >   INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    9    11      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.6 ms | 1395 KiB | 15 Q