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 'hello': echo 'hello'; break; case $i: default: break; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
filename:       /in/IHNuH
function name:  (null)
number of ops:  25
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, ->15
   19     6    >   IS_EQUAL                                                 !0, 0
          7      > JMPNZ                                                    ~4, ->17
   22     8    >   IS_EQUAL                                                 !0, '1'
          9      > JMPNZ                                                    ~4, ->19
   25    10    >   IS_EQUAL                                                 !0, 'hello'
         11      > JMPNZ                                                    ~4, ->21
   28    12    >   IS_EQUAL                                                 !0, !0
         13      > JMPNZ                                                    ~4, ->23
         14    > > JMP                                                      ->23
   17    15    >   ECHO                                                     'NULL'
   18    16      > JMP                                                      ->24
   20    17    >   ECHO                                                     'int+zero'
   21    18      > JMP                                                      ->24
   23    19    >   ECHO                                                     'one'
   24    20      > JMP                                                      ->24
   26    21    >   ECHO                                                     'hello'
   27    22      > JMP                                                      ->24
   30    23    > > JMP                                                      ->24
   31    24    > > RETURN                                                   1

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