3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = Array ( "Ron" => Array ( "subject1" => Array ( "test1" => 47, "test2" => 86, "total" => 133, "percentage" => 88.67, "status" => "Pass", "pass_count" => 8, "fail_count" => 0, "gross_total" => 963, "gross_percentage" => 80.25, ), "subject8" => Array ( "test1" => 48, "test2" => 86, "total" => 134, "percentage" => 89.33, "status" => "Pass", "pass_count" => 8, "fail_count" => 0, "gross_total" => 900, "gross_percentage" => 75.50, ), ), "John" => Array ( "subject1" => Array ( "test1" => 39, "test2" => 72, "total" => 111, "percentage" => 74, "status" => "Pass", "pass_count" => 8, "fail_count" => 0, "gross_total" => 963, "gross_percentage" => 80.25, ), "subject8" => Array ( "test1" => 39, "test2" => 75, "total" => 114, "percentage" => 76, "status" => "Pass", "pass_count" => 8, "fail_count" => 0, "gross_total" => 846, "gross_percentage" => 70.5, ), ), ); print_r($data); $table = table_cell($data); echo $table; function table_cell($data) { $return = "<table border='1'>"; foreach ($data as $key => $value) { $return .= "<tr><td>$key</td><td>"; if (is_array($value)) { $return .= table_cell($value); } else { $return .= $value; } $return .= "</td><tr>"; } $return .= "</tr></table>"; return($return); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0n1qW
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data, !1 = $table
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   73     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   74     4        INIT_FCALL_BY_NAME                                       'table_cell'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   75     8        ECHO                                                     !1
   93     9      > RETURN                                                   1

Function table_cell:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/0n1qW
function name:  table_cell
number of ops:  23
compiled vars:  !0 = $data, !1 = $return, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   78     0  E >   RECV                                             !0      
   80     1        ASSIGN                                                   !1, '%3Ctable+border%3D%271%27%3E'
   81     2      > FE_RESET_R                                       $5      !0, ->19
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->19
          4    >   ASSIGN                                                   !3, ~6
   82     5        ROPE_INIT                                     3  ~9      '%3Ctr%3E%3Ctd%3E'
          6        ROPE_ADD                                      1  ~9      ~9, !3
          7        ROPE_END                                      2  ~8      ~9, '%3C%2Ftd%3E%3Ctd%3E'
          8        ASSIGN_OP                                     8          !1, ~8
   83     9        TYPE_CHECK                                  128          !2
         10      > JMPZ                                                     ~12, ->16
   84    11    >   INIT_FCALL_BY_NAME                                       'table_cell'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0  $13     
         14        ASSIGN_OP                                     8          !1, $13
         15      > JMP                                                      ->17
   86    16    >   ASSIGN_OP                                     8          !1, !2
   88    17    >   ASSIGN_OP                                     8          !1, '%3C%2Ftd%3E%3Ctr%3E'
   81    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
   90    20        ASSIGN_OP                                     8          !1, '%3C%2Ftr%3E%3C%2Ftable%3E'
   91    21      > RETURN                                                   !1
   93    22*     > RETURN                                                   null

End of function table_cell

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.19 ms | 1400 KiB | 15 Q