3v4l.org

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

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

End of function equals

End of class BaseTest.

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

End of function equals

End of class Test.

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

End of function equals

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.58 ms | 1400 KiB | 15 Q