3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function data($query) { $data = null; for ($i = 1; $i <= 100000; $i++) { $data = $this->format($this->search($this->factory(), $query)); } return var_dump($data); } protected function factory() { return array( 'hello world', 'test 123', 'laravel', 'php', 'twitter', 'liquid', 'twekkisd', 'tekkit', 'minecrtafspeltwrong', 'minecraft', 'java', 'hhvm', 'qwertuop', 'qwerty', 'abc', 'coffee', 'dsmg', 'admin@dsmg.co.uk', 'graham@dsmg.co.uk' ); } protected function search($data, $query) { foreach ($data as $key => $value) { if (strpos($value, $query) === false) { unset($data[$key]); } } return $data; } protected function format($data) { $new = array(); foreach($data as $value) { $tmp = new stdClass; $tmp->val = $value; $new[] = $tmp; } return $new; } } $test = new Test; $test->data('t');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2fohs
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   62     3        INIT_METHOD_CALL                                         !0, 'data'
          4        SEND_VAL_EX                                              't'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Test:
Function data:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 4
Branch analysis from position: 17
Branch analysis from position: 4
filename:       /in/2fohs
function name:  data
number of ops:  22
compiled vars:  !0 = $query, !1 = $data, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, null
    8     2        ASSIGN                                                   !2, 1
          3      > JMP                                                      ->15
    9     4    >   INIT_METHOD_CALL                                         'format'
          5        INIT_METHOD_CALL                                         'search'
          6        INIT_METHOD_CALL                                         'factory'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR_NO_REF_EX                                       $5
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR_NO_REF_EX                                       $6
         12        DO_FCALL                                      0  $7      
         13        ASSIGN                                                   !1, $7
    8    14        PRE_INC                                                  !2
         15    >   IS_SMALLER_OR_EQUAL                                      !2, 100000
         16      > JMPNZ                                                    ~10, ->4
   11    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $11     
         20      > RETURN                                                   $11
   12    21*     > RETURN                                                   null

End of function data

Function factory:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2fohs
function name:  factory
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   <array>
   37     1*     > RETURN                                                   null

End of function factory

Function search:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/2fohs
function name:  search
number of ops:  16
compiled vars:  !0 = $data, !1 = $query, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   41     2      > FE_RESET_R                                       $4      !0, ->13
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->13
          4    >   ASSIGN                                                   !3, ~5
   42     5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        TYPE_CHECK                                    4          $7
         10      > JMPZ                                                     ~8, ->12
   43    11    >   UNSET_DIM                                                !0, !3
   41    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $4
   46    14      > RETURN                                                   !0
   47    15*     > RETURN                                                   null

End of function search

Function format:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/2fohs
function name:  format
number of ops:  15
compiled vars:  !0 = $data, !1 = $new, !2 = $value, !3 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
   51     1        ASSIGN                                                   !1, <array>
   52     2      > FE_RESET_R                                       $5      !0, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
   53     4    >   NEW                                              $6      'stdClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !3, $6
   54     7        ASSIGN_OBJ                                               !3, 'val'
          8        OP_DATA                                                  !2
   55     9        ASSIGN_DIM                                               !1
         10        OP_DATA                                                  !3
   52    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   57    13      > RETURN                                                   !1
   58    14*     > RETURN                                                   null

End of function format

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1396 KiB | 17 Q