3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class BaseTest { public function toFloat() { return 0.0; } public function equals($value) { return $value instanceof static; } } class Test extends BaseTest { } class Test2 extends BaseTest { public function toFloat($useOne = false) { return $useOne ? 1.0 : 0.0; } } $a = new Test(); $b = new Test(); $c = new Test2(); var_dump($a->toFloat()); var_dump($b->toFloat());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3fb7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   24     3        NEW                                              $6      'Test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   25     6        NEW                                              $9      'Test2'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   26     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'toFloat'
         11        DO_FCALL                                      0  $12     
         12        SEND_VAR                                                 $12
         13        DO_ICALL                                                 
   27    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'toFloat'
         16        DO_FCALL                                      0  $14     
         17        SEND_VAR                                                 $14
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

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

End of function tofloat

Function equals:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3fb7
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function equals

End of class BaseTest.

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

End of function tofloat

Function equals:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3fb7
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function equals

End of class Test.

Class Test2:
Function tofloat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3fb7
function name:  toFloat
number of ops:  7
compiled vars:  !0 = $useOne
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV_INIT                                        !0      <false>
   19     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      1
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      0
          5    > > RETURN                                                   ~1
   20     6*     > RETURN                                                   null

End of function tofloat

Function equals:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3fb7
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function equals

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.97 ms | 1400 KiB | 15 Q