3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * isTeamSizeOK method * * Method used to check that the number of competitors being registered for this team fall within the accepted ranges defined within the teams chosen level * * @param string $level_id This is the level_id selected for this competitor's team * @return mixed */ function isTeamSizeOK($level_id) { $data = array( array('field1' => 'value1', 'field2' => 'value2'), array('field1' => 'value1', 'field2' => 'value2'), array('field1' => 'value1', 'field2' => 'value2'), array('field1' => 'value1', 'field2' => 'value2') ); $number_of_competitors = count($data); // TODO verify that this contains the entire array of competitors being added to this team $team_size_range = '4-9'; $team_size_range_arr = explode('-', $team_size_range); if (stripos($team_size_range_arr[0], 'N/A') !== false) { return true; } if (stripos($team_size_range_arr[1], 'N/A') !== false) { $team_size_range_arr[1] = 1000; } if ($number_of_competitors >= $team_size_range_arr[0] && $number_of_competitors <= $team_size_range_arr[1]) { return true; } return false; } echo isTeamSizeOk(NULL);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4j26j
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'isteamsizeok'
          1        SEND_VAL                                                 null
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function isteamsizeok:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 35
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 27
filename:       /in/4j26j
function name:  isTeamSizeOK
number of ops:  37
compiled vars:  !0 = $level_id, !1 = $data, !2 = $number_of_competitors, !3 = $team_size_range, !4 = $team_size_range_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, <array>
   19     2        COUNT                                            ~6      !1
          3        ASSIGN                                                   !2, ~6
   20     4        ASSIGN                                                   !3, '4-9'
   21     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '-'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !4, $9
   23    10        INIT_FCALL                                               'stripos'
         11        FETCH_DIM_R                                      ~11     !4, 0
         12        SEND_VAL                                                 ~11
         13        SEND_VAL                                                 'N%2FA'
         14        DO_ICALL                                         $12     
         15        TYPE_CHECK                                  1018          $12
         16      > JMPZ                                                     ~13, ->18
         17    > > RETURN                                                   <true>
   25    18    >   INIT_FCALL                                               'stripos'
         19        FETCH_DIM_R                                      ~14     !4, 1
         20        SEND_VAL                                                 ~14
         21        SEND_VAL                                                 'N%2FA'
         22        DO_ICALL                                         $15     
         23        TYPE_CHECK                                  1018          $15
         24      > JMPZ                                                     ~16, ->27
         25    >   ASSIGN_DIM                                               !4, 1
         26        OP_DATA                                                  1000
   27    27    >   FETCH_DIM_R                                      ~18     !4, 0
         28        IS_SMALLER_OR_EQUAL                              ~19     ~18, !2
         29      > JMPZ_EX                                          ~19     ~19, ->33
         30    >   FETCH_DIM_R                                      ~20     !4, 1
         31        IS_SMALLER_OR_EQUAL                              ~21     !2, ~20
         32        BOOL                                             ~19     ~21
         33    > > JMPZ                                                     ~19, ->35
   28    34    > > RETURN                                                   <true>
   31    35    > > RETURN                                                   <false>
   32    36*     > RETURN                                                   null

End of function isteamsizeok

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.69 ms | 1403 KiB | 18 Q