3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Figure { protected $color; protected $position; abstract public function move($a, $b); } class Bishop extends Figure { public function move($a, $b) { return true; } } class Rook extends Figure { public function move($a, $b) { return false; } } class Queen extends Figure { public function move($a, $b) { return false; } } $bishop = new Bishop(); assert($bighop->move('E2', 'E4') === false); assert($bighop->move('E2', 'A6') === true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0ev6
function name:  (null)
number of ops:  24
compiled vars:  !0 = $bishop, !1 = $bighop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $2      'Bishop'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   31     3        ASSERT_CHECK                                             
          4        INIT_FCALL                                               'assert'
          5        INIT_METHOD_CALL                                         !1, 'move'
          6        SEND_VAL_EX                                              'E2'
          7        SEND_VAL_EX                                              'E4'
          8        DO_FCALL                                      0  $5      
          9        TYPE_CHECK                                    4  ~6      $5
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 'assert%28%24bighop-%3Emove%28%27E2%27%2C+%27E4%27%29+%3D%3D%3D+false%29'
         12        DO_ICALL                                                 
   32    13        ASSERT_CHECK                                             
         14        INIT_FCALL                                               'assert'
         15        INIT_METHOD_CALL                                         !1, 'move'
         16        SEND_VAL_EX                                              'E2'
         17        SEND_VAL_EX                                              'A6'
         18        DO_FCALL                                      0  $8      
         19        TYPE_CHECK                                    8  ~9      $8
         20        SEND_VAL                                                 ~9
         21        SEND_VAL                                                 'assert%28%24bighop-%3Emove%28%27E2%27%2C+%27A6%27%29+%3D%3D%3D+true%29'
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Class Figure:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0ev6
function name:  move
number of ops:  3
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function move

End of class Figure.

Class Bishop:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0ev6
function name:  move
number of ops:  4
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2      > RETURN                                                   <true>
   13     3*     > RETURN                                                   null

End of function move

End of class Bishop.

Class Rook:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0ev6
function name:  move
number of ops:  4
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2      > RETURN                                                   <false>
   19     3*     > RETURN                                                   null

End of function move

End of class Rook.

Class Queen:
Function move:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k0ev6
function name:  move
number of ops:  4
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2      > RETURN                                                   <false>
   26     3*     > RETURN                                                   null

End of function move

End of class Queen.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.41 ms | 1400 KiB | 15 Q