3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Courier implements Countable { protected $count = 0; public function ship(Parcel $parcel) { $this->count++; return true; } public function count() { return $this->count; } } $courier = new Courier(); $courier->ship(new Parcel()); $courier->ship(new Parcel()); $courier->ship(new Parcel()); $courier->ship(new Parcel()); echo count($courier);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jvDs5
function name:  (null)
number of ops:  27
compiled vars:  !0 = $courier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'courier'
   17     1        NEW                                              $1      'Courier'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_METHOD_CALL                                         !0, 'ship'
          5        NEW                                              $4      'Parcel'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
   19     9        INIT_METHOD_CALL                                         !0, 'ship'
         10        NEW                                              $7      'Parcel'
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $7
         13        DO_FCALL                                      0          
   20    14        INIT_METHOD_CALL                                         !0, 'ship'
         15        NEW                                              $10     'Parcel'
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $10
         18        DO_FCALL                                      0          
   21    19        INIT_METHOD_CALL                                         !0, 'ship'
         20        NEW                                              $13     'Parcel'
         21        DO_FCALL                                      0          
         22        SEND_VAR_NO_REF_EX                                       $13
         23        DO_FCALL                                      0          
   22    24        COUNT                                            ~16     !0
         25        ECHO                                                     ~16
         26      > RETURN                                                   1

Class Courier:
Function ship:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jvDs5
function name:  ship
number of ops:  4
compiled vars:  !0 = $parcel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        PRE_INC_OBJ                                              'count'
    8     2      > RETURN                                                   <true>
   10     3*     > RETURN                                                   null

End of function ship

Function count:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jvDs5
function name:  count
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'count'
          1      > RETURN                                                   ~0
   14     2*     > RETURN                                                   null

End of function count

End of class Courier.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.86 ms | 1395 KiB | 13 Q