3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $box; public function setBox(array $box) { if (count($box) !== 4) { throw new InvalidArgumentException('The "$box" parameter must be an array with 4 values.'); } // Breaks FPM and gives a 502 due to connection reset by peers list($lat1, $lon1, $lat2, $lon2) = $this->box = $box; // Works perfectly fine // $this->box = $box; // list($lat1, $lon1, $lat2, $lon2) = $this->box; return $this; } } $foo = new Foo; $foo->setBox(explode(',', '40.688235,-74.013718,40.756427,-73.958770')); echo "Success";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dntL5
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'setBox'
          4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%2C'
          6        SEND_VAL                                                 '40.688235%2C-74.013718%2C40.756427%2C-73.958770'
          7        DO_ICALL                                         $4      
          8        SEND_VAR_NO_REF_EX                                       $4
          9        DO_FCALL                                      0          
   26    10        ECHO                                                     'Success'
         11      > RETURN                                                   1

Class Foo:
Function setbox:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dntL5
function name:  setBox
number of ops:  22
compiled vars:  !0 = $box, !1 = $lat1, !2 = $lon1, !3 = $lat2, !4 = $lon2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        COUNT                                            ~5      !0
          2        IS_NOT_IDENTICAL                                         ~5, 4
          3      > JMPZ                                                     ~6, ->8
    9     4    >   NEW                                              $7      'InvalidArgumentException'
          5        SEND_VAL_EX                                              'The+%22%24box%22+parameter+must+be+an+array+with+4+values.'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $7
   13     8    >   ASSIGN_OBJ                                       ~9      'box'
          9        OP_DATA                                                  !0
         10        FETCH_LIST_R                                     $10     ~9, 0
         11        ASSIGN                                                   !1, $10
         12        FETCH_LIST_R                                     $12     ~9, 1
         13        ASSIGN                                                   !2, $12
         14        FETCH_LIST_R                                     $14     ~9, 2
         15        ASSIGN                                                   !3, $14
         16        FETCH_LIST_R                                     $16     ~9, 3
         17        ASSIGN                                                   !4, $16
         18        FREE                                                     ~9
   19    19        FETCH_THIS                                       ~18     
         20      > RETURN                                                   ~18
   20    21*     > RETURN                                                   null

End of function setbox

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1396 KiB | 15 Q