3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 'counters' => [ 'success' => 1, 'failed' => 3 ], 'aa' => [1,2,3], 'column_errors' => false ]; $update = array( 'column_errors' => true, ); class Job { private $data; public function __construct(array $data) { $this->data = $data; } public function getData() { return $this->data; } public function updateDataWith(array $update) { $result = array_replace_recursive($this->data, $update); if (is_null($result)) { throw new \RuntimeException; } $this->data = $result; } } $job = new Job($a); $job->updateDataWith($update); var_dump($job->getData());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DsDEJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $update, !2 = $job
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, <array>
   41     2        NEW                                              $5      'Job'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $5
   42     6        INIT_METHOD_CALL                                         !2, 'updateDataWith'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   43     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !2, 'getData'
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Job:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DsDEJ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               'data'
          2        OP_DATA                                                  !0
   23     3      > RETURN                                                   null

End of function __construct

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

End of function getdata

Function updatedatawith:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DsDEJ
function name:  updateDataWith
number of ops:  15
compiled vars:  !0 = $update, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   32     1        INIT_FCALL                                               'array_replace_recursive'
          2        FETCH_OBJ_R                                      ~2      'data'
          3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
   33     7        TYPE_CHECK                                    2          !1
          8      > JMPZ                                                     ~5, ->12
   34     9    >   NEW                                              $6      'RuntimeException'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $6
   37    12    >   ASSIGN_OBJ                                               'data'
         13        OP_DATA                                                  !1
   38    14      > RETURN                                                   null

End of function updatedatawith

End of class Job.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.36 ms | 1392 KiB | 17 Q