3v4l.org

run code in 500+ 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:  4
compiled vars:  !0 = $entry
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        FRAMELESS_ICALL_1                trim                ~1      !0
          2      > RETURN                                                       ~1
    8     3*     > 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:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'array_map'
          1        SEND_VAL                                                     <array>
          2        FETCH_OBJ_R                                          ~0      'entries'
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                             $1      
          5        FRAMELESS_ICALL_2                implode             ~2      '%0A%0A', $1
          6      > RETURN                                                       ~2
   12     7*     > 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:  9
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        FETCH_OBJ_R                                          ~2      'entries'
          6        FRAMELESS_ICALL_2                implode             ~3      '%0A%0A', ~2
          7      > RETURN                                                       ~3
   17     8*     > 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:  10
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        FRAMELESS_ICALL_2                implode             ~5      '%0A%0A', !0
          8      > RETURN                                                       ~5
   23     9*     > RETURN                                                       null

End of function export_entriesc

End of class PO.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
230.61 ms | 3447 KiB | 16 Q