3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace FOO; class FOO { public const FOO = null; public $X = null; public function BAR(): void {} } echo class_exists('foo\foo') ? 'x':'o'; echo method_exists(FOO::class, 'bar') ? 'x':'o'; echo property_exists(FOO::class, 'x') ? 'x':'o'; echo defined(FOO::class.'::foo')? 'x':'o';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
Branch analysis from position: 32
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
Branch analysis from position: 15
filename:       /in/gMUTO
function name:  (null)
number of ops:  35
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'FOO%5Cclass_exists'
          1        SEND_VAL_EX                                              'foo%5Cfoo'
          2        DO_FCALL                                      0  $0      
          3      > JMPZ                                                     $0, ->6
          4    >   QM_ASSIGN                                        ~1      'x'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~1      'o'
          7    >   ECHO                                                     ~1
   10     8        INIT_NS_FCALL_BY_NAME                                    'FOO%5Cmethod_exists'
          9        SEND_VAL_EX                                              'FOO%5CFOO'
         10        SEND_VAL_EX                                              'bar'
         11        DO_FCALL                                      0  $2      
         12      > JMPZ                                                     $2, ->15
         13    >   QM_ASSIGN                                        ~3      'x'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~3      'o'
         16    >   ECHO                                                     ~3
   11    17        INIT_NS_FCALL_BY_NAME                                    'FOO%5Cproperty_exists'
         18        SEND_VAL_EX                                              'FOO%5CFOO'
         19        SEND_VAL_EX                                              'x'
         20        DO_FCALL                                      0  $4      
         21      > JMPZ                                                     $4, ->24
         22    >   QM_ASSIGN                                        ~5      'x'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~5      'o'
         25    >   ECHO                                                     ~5
   12    26        INIT_NS_FCALL_BY_NAME                                    'FOO%5Cdefined'
         27        SEND_VAL_EX                                              'FOO%5CFOO%3A%3Afoo'
         28        DO_FCALL                                      0  $6      
         29      > JMPZ                                                     $6, ->32
         30    >   QM_ASSIGN                                        ~7      'x'
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~7      'o'
         33    >   ECHO                                                     ~7
         34      > RETURN                                                   1

Class FOO\FOO:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gMUTO
function name:  BAR
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function bar

End of class FOO\FOO.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.47 ms | 1400 KiB | 21 Q