3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private array $array = [['value' => 'Test']]; public function getValue() { return $this->array; } public function doSomething() { return array_map(fn($x) => $x ?? null, ...$this->getValue())['value'] ?? null; } } print_r((new Foo)->doSomething());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k6mB9
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'print_r'
          1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'doSomething'
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

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

End of function getvalue

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k6mB9
function name:  doSomething
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                          ~0      [0]
          2        SEND_VAL                                                 ~0
          3        INIT_METHOD_CALL                                         'getValue'
          4        DO_FCALL                                      0  $1      
          5        SEND_UNPACK                                              $1
          6        CHECK_UNDEF_ARGS                                         
          7        DO_ICALL                                         $2      
          8        FETCH_DIM_IS                                     ~3      $2, 'value'
          9        COALESCE                                         ~4      ~3
         10        QM_ASSIGN                                        ~4      null
         11      > RETURN                                                   ~4
   15    12*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k6mB9
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        COALESCE                                         ~1      !0
          2        QM_ASSIGN                                        ~1      null
          3      > RETURN                                                   ~1
          4*     > RETURN                                                   null

End of Dynamic Function 0

End of function dosomething

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.96 ms | 1012 KiB | 15 Q