3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StrTo { public function __toString() { $result = 'hello'; var_dump($result); return $result; } } $i = new StrTo(); switch ($i) { case NULL: echo "NULL"; break; case 0: echo 'int zero'; break; case '1': echo 'one'; break; case $i: default: break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
filename:       /in/MYgo0
function name:  (null)
number of ops:  21
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'strto'
   12     1        NEW                                              $1      'StrTo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        IS_EQUAL                                                 !0, null
          5      > JMPNZ                                                    ~4, ->13
   19     6    >   IS_EQUAL                                                 !0, 0
          7      > JMPNZ                                                    ~4, ->15
   22     8    >   IS_EQUAL                                                 !0, '1'
          9      > JMPNZ                                                    ~4, ->17
   25    10    >   IS_EQUAL                                                 !0, !0
         11      > JMPNZ                                                    ~4, ->19
         12    > > JMP                                                      ->19
   17    13    >   ECHO                                                     'NULL'
   18    14      > JMP                                                      ->20
   20    15    >   ECHO                                                     'int+zero'
   21    16      > JMP                                                      ->20
   23    17    >   ECHO                                                     'one'
   24    18      > JMP                                                      ->20
   27    19    > > JMP                                                      ->20
   28    20    > > RETURN                                                   1

Class StrTo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MYgo0
function name:  __toString
number of ops:  8
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, 'hello'
    7     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4        VERIFY_RETURN_TYPE                                       !0
          5      > RETURN                                                   !0
    9     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function __tostring

End of class StrTo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.49 ms | 1400 KiB | 15 Q