3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test; 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(Test::class); var_dump(class_basename(Test::class));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5HXDm
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $3      'Test%5CTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   26     3        NEW                                              $6      'Test%5CTest'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   27     6        NEW                                              $9      'Test%5CTest2'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $9
   28     9        INIT_NS_FCALL_BY_NAME                                    'Test%5Cvar_dump'
         10        SEND_VAL_EX                                              'Test%5CTest'
         11        DO_FCALL                                      0          
   29    12        INIT_NS_FCALL_BY_NAME                                    'Test%5Cvar_dump'
         13        INIT_NS_FCALL_BY_NAME                                    'Test%5Cclass_basename'
         14        SEND_VAL_EX                                              'Test%5CTest'
         15        DO_FCALL                                      0  $13     
         16        SEND_VAR_NO_REF_EX                                       $13
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Class Test\BaseTest:
Function tofloat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5HXDm
function name:  toFloat
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   0
    8     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/5HXDm
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function equals

End of class Test\BaseTest.

Class Test\Test:
Function tofloat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5HXDm
function name:  toFloat
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   0
    8     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/5HXDm
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function equals

End of class Test\Test.

Class Test\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/5HXDm
function name:  toFloat
number of ops:  7
compiled vars:  !0 = $useOne
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV_INIT                                        !0      <false>
   21     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      1
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      0
          5    > > RETURN                                                   ~1
   22     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/5HXDm
function name:  equals
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INSTANCEOF                                       ~1      !0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function equals

End of class Test\Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.24 ms | 1407 KiB | 16 Q