3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PO { public $entries = array( "1\n", "a\n\n" ); public static function export_entry( &$entry ) { return trim($entry); } function export_entriesA() { return implode( "\n\n", array_map( array( 'PO', 'export_entry' ), $this->entries ) ); } function export_entriesB() { array_walk( $this->entries, array( 'PO', 'export_entry' ) ); return implode( "\n\n", $this->entries ); } function export_entriesC() { $entries = $this->entries; array_walk( $this->entries, array( 'PO', 'export_entry' ) ); return implode( "\n\n", $entries ); } } $obj = new PO(); var_dump($obj->export_entriesA()); var_dump($obj->entries); var_dump($obj->export_entriesC()); var_dump($obj->entries); var_dump($obj->export_entriesB()); var_dump($obj->entries);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KbpLJ
function name:  (null)
number of ops:  31
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'PO'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'export_entriesA'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   29     8        INIT_FCALL                                               'var_dump'
          9        FETCH_OBJ_R                                      ~6      !0, 'entries'
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
   30    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !0, 'export_entriesC'
         14        DO_FCALL                                      0  $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
   31    17        INIT_FCALL                                               'var_dump'
         18        FETCH_OBJ_R                                      ~10     !0, 'entries'
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                                 
   32    21        INIT_FCALL                                               'var_dump'
         22        INIT_METHOD_CALL                                         !0, 'export_entriesB'
         23        DO_FCALL                                      0  $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
   33    26        INIT_FCALL                                               'var_dump'
         27        FETCH_OBJ_R                                      ~14     !0, 'entries'
         28        SEND_VAL                                                 ~14
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Class PO:
Function export_entry:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KbpLJ
function name:  export_entry
number of ops:  6
compiled vars:  !0 = $entry
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    8     5*     > RETURN                                                   null

End of function export_entry

Function export_entriesa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KbpLJ
function name:  export_entriesA
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '%0A%0A'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 <array>
          4        FETCH_OBJ_R                                      ~0      'entries'
          5        SEND_VAL                                                 ~0
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9      > RETURN                                                   $2
   12    10*     > RETURN                                                   null

End of function export_entriesa

Function export_entriesb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KbpLJ
function name:  export_entriesB
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'array_walk'
          1        FETCH_OBJ_W                                      $0      'entries'
          2        SEND_REF                                                 $0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                                 
   16     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%0A%0A'
          7        FETCH_OBJ_R                                      ~2      'entries'
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
   17    11*     > RETURN                                                   null

End of function export_entriesb

Function export_entriesc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KbpLJ
function name:  export_entriesC
number of ops:  13
compiled vars:  !0 = $entries
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~1      'entries'
          1        ASSIGN                                                   !0, ~1
   21     2        INIT_FCALL                                               'array_walk'
          3        FETCH_OBJ_W                                      $3      'entries'
          4        SEND_REF                                                 $3
          5        SEND_VAL                                                 <array>
          6        DO_ICALL                                                 
   22     7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%0A%0A'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11      > RETURN                                                   $5
   23    12*     > RETURN                                                   null

End of function export_entriesc

End of class PO.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.5 ms | 1400 KiB | 23 Q