3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('A', null); class Foo { const NO_VALUE = null; public static function bar($param = self::NO_VALUE) { if ($param == self::NO_VALUE) echo "Param was NO_VALUE"; else echo "Param was a valid instance of Foo"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/viAIY
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'A'
          2        SEND_VAL                                                 null
          3        DO_ICALL                                                 
   12     4      > RETURN                                                   1

Class Foo:
Function bar:
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 = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/viAIY
function name:  bar
number of ops:  7
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      <const ast>
    7     1        IS_EQUAL                                                 !0, null
          2      > JMPZ                                                     ~1, ->5
    8     3    >   ECHO                                                     'Param+was+NO_VALUE'
          4      > JMP                                                      ->6
   10     5    >   ECHO                                                     'Param+was+a+valid+instance+of+Foo'
   11     6    > > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.64 ms | 1395 KiB | 15 Q