3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $box; public function setBox(array $box) { // Segfault // 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/94Bkk
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     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          
   22    10        ECHO                                                     'Success'
         11      > RETURN                                                   1

Class Foo:
Function setbox:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/94Bkk
function name:  setBox
number of ops:  16
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      
   12     1        ASSIGN_OBJ                                               'box'
          2        OP_DATA                                                  !0
   13     3        FETCH_OBJ_R                                      ~6      'box'
          4        FETCH_LIST_R                                     $7      ~6, 0
          5        ASSIGN                                                   !1, $7
          6        FETCH_LIST_R                                     $9      ~6, 1
          7        ASSIGN                                                   !2, $9
          8        FETCH_LIST_R                                     $11     ~6, 2
          9        ASSIGN                                                   !3, $11
         10        FETCH_LIST_R                                     $13     ~6, 3
         11        ASSIGN                                                   !4, $13
         12        FREE                                                     ~6
   15    13        FETCH_THIS                                       ~15     
         14      > RETURN                                                   ~15
   16    15*     > RETURN                                                   null

End of function setbox

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.74 ms | 1396 KiB | 15 Q