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': echo 'one'; break; case 'hello': echo 'hello'; 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 = 13
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 13
filename:       /in/DepKt
function name:  (null)
number of ops:  18
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, ->13
   17     6    >   IS_EQUAL                                                 !0, '1'
          7      > JMPNZ                                                    ~4, ->13
   20     8    >   IS_EQUAL                                                 !0, 'hello'
          9      > JMPNZ                                                    ~4, ->15
   22    10    >   IS_EQUAL                                                 !0, !0
         11      > JMPNZ                                                    ~4, ->16
         12    > > JMP                                                      ->16
   18    13    >   ECHO                                                     'one'
   19    14      > JMP                                                      ->17
   21    15    >   ECHO                                                     'hello'
   24    16    > > JMP                                                      ->17
   25    17    > > RETURN                                                   1

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