3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); if (! class_exists('undefined')) { class undefined {} } if (! defined('undefined')) { define('undefined', new undefined()); } class X { function foo( SomeType|undefined $object = undefined, bool|undefined $option = undefined, ) { return match($object) { undefined => new DefaultBehavior(), default => $object->someMethod() }; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/avVQD
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FRAMELESS_ICALL_1                class_exists        ~0      'undefined'
          1        BOOL_NOT                                             ~1      ~0
          2      > JMPZ                                                         ~1, ->4
    6     3    >   DECLARE_CLASS                                                'undefined'
    9     4    >   DEFINED                                              ~2      'undefined'
          5        BOOL_NOT                                             ~3      ~2
          6      > JMPZ                                                         ~3, ->13
   10     7    >   INIT_FCALL                                                   'define'
          8        SEND_VAL                                                     'undefined'
          9        NEW                                                  $4      'undefined'
         10        DO_FCALL                                          0          
         11        SEND_VAR                                                     $4
         12        DO_ICALL                                                     
   23    13    > > RETURN                                                       1

Class undefined: [no user functions]
Class X:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
filename:       /in/avVQD
function name:  foo
number of ops:  16
compiled vars:  !0 = $object, !1 = $option
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                            !0      <const ast>
   16     1        RECV_INIT                                            !1      <const ast>
   19     2        FETCH_CONSTANT                                       ~3      'undefined'
          3        IS_IDENTICAL                                                 !0, ~3
          4      > JMPNZ                                                        ~2, ->6
          5    > > JMP                                                          ->10
          6    >   NEW                                                  $4      'DefaultBehavior'
          7        DO_FCALL                                          0          
          8        QM_ASSIGN                                            ~6      $4
          9      > JMP                                                          ->14
   20    10    >   INIT_METHOD_CALL                                             !0, 'someMethod'
         11        DO_FCALL                                          0  $7      
         12        QM_ASSIGN                                            ~6      $7
         13      > JMP                                                          ->14
         14    > > RETURN                                                       ~6
   22    15*     > RETURN                                                       null

End of function foo

End of class X.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
175.17 ms | 1108 KiB | 14 Q