3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { echo $this->formatColumnsWithValues(['key' => 'value', 'foo' => 'bar', 'empty' => '']); } private function formatColumnsWithValues(array $kRow): string { $kRow = array_filter($kRow); array_walk($kRow, fn (&$v, $k) => $v = sprintf("%s: %s\n", $k, $v)); return implode("</p><p>", $kRow); } } $a = new A();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4GKCW
function name:  (null)
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4GKCW
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'formatColumnsWithValues'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
    8     4      > RETURN                                                   null

End of function __construct

Function formatcolumnswithvalues:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4GKCW
function name:  formatColumnsWithValues
number of ops:  18
compiled vars:  !0 = $kRow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   13     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !0
          7        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'implode'
         11        SEND_VAL                                                 '%3C%2Fp%3E%3Cp%3E'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        VERIFY_RETURN_TYPE                                       $5
         15      > RETURN                                                   $5
   15    16*       VERIFY_RETURN_TYPE                                       
         17*     > 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/4GKCW
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%25s%3A+%25s%0A'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        ASSIGN                                           ~3      !0, $2
          8      > RETURN                                                   ~3
          9*     > RETURN                                                   null

End of Dynamic Function 0

End of function formatcolumnswithvalues

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.17 ms | 1008 KiB | 17 Q