3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PriceList { /** * @var float[] */ protected $data = []; public function addPrice(float $price): void { $this->data[] = $price; } /** * @return float[] Array of prices */ public function all(): array { return $this->data; } } $priceList = new PriceList(); $priceList->addPrice(29.99); $priceList->addPrice(89); $priceList->addPrice(199); print_r($priceList->all());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EKmWb
function name:  (null)
number of ops:  18
compiled vars:  !0 = $priceList
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'PriceList'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'addPrice'
          4        SEND_VAL_EX                                              29.99
          5        DO_FCALL                                      0          
   26     6        INIT_METHOD_CALL                                         !0, 'addPrice'
          7        SEND_VAL_EX                                              89
          8        DO_FCALL                                      0          
   27     9        INIT_METHOD_CALL                                         !0, 'addPrice'
         10        SEND_VAL_EX                                              199
         11        DO_FCALL                                      0          
   29    12        INIT_FCALL                                               'print_r'
         13        INIT_METHOD_CALL                                         !0, 'all'
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class PriceList:
Function addprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EKmWb
function name:  addPrice
number of ops:  5
compiled vars:  !0 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        FETCH_OBJ_W                                      $1      'data'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   13     4      > RETURN                                                   null

End of function addprice

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

End of function all

End of class PriceList.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.05 ms | 1444 KiB | 14 Q