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 1: case '1': case $i: default: break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 11
Branch analysis from position: 11
filename:       /in/3Srjn
function name:  (null)
number of ops:  13
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
   16     4        IS_EQUAL                                                 !0, 1
          5      > JMPNZ                                                    ~4, ->11
   17     6    >   IS_EQUAL                                                 !0, '1'
          7      > JMPNZ                                                    ~4, ->11
   18     8    >   IS_EQUAL                                                 !0, !0
          9      > JMPNZ                                                    ~4, ->11
         10    > > JMP                                                      ->11
   20    11    > > JMP                                                      ->12
   21    12    > > RETURN                                                   1

Class StrTo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Srjn
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:
156.32 ms | 1396 KiB | 15 Q