3v4l.org

run code in 300+ PHP versions simultaneously
<?php if($position) { $jobs = Job::where('title', 'LIKE', '%' . $position . '%'); $jobs->where('status', '<', 2); if($location) { $jobs->whereMetaIn("location", (array)$location); } if ($employment) { $jobs->withAnyTag($employment); } if ($jobs->get()->count()) { $jobsBy = "position"; } } // if no jobs by position, try with location... if($location && !$jobsBy) { $jobs = Job::whereMetaIn('location', (array)$location); $jobs->where('status', '<', 2); if($employment) { $jobs->withAnyTag($employment); } if ($jobs->get()->count()) { $jobsBy = "location"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 30
Branch analysis from position: 1
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 30
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 55
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 49
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 55
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
Branch analysis from position: 49
Branch analysis from position: 55
Branch analysis from position: 33
Branch analysis from position: 30
Branch analysis from position: 24
Branch analysis from position: 20
Branch analysis from position: 30
filename:       /in/JoTN1
function name:  (null)
number of ops:  56
compiled vars:  !0 = $position, !1 = $jobs, !2 = $location, !3 = $employment, !4 = $jobsBy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     !0, ->30
    4     1    >   INIT_STATIC_METHOD_CALL                                  'Job', 'where'
          2        SEND_VAL_EX                                              'title'
          3        SEND_VAL_EX                                              'LIKE'
          4        CONCAT                                           ~5      '%25', !0
          5        CONCAT                                           ~6      ~5, '%25'
          6        SEND_VAL_EX                                              ~6
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
    5     9        INIT_METHOD_CALL                                         !1, 'where'
         10        SEND_VAL_EX                                              'status'
         11        SEND_VAL_EX                                              '%3C'
         12        SEND_VAL_EX                                              2
         13        DO_FCALL                                      0          
    6    14      > JMPZ                                                     !2, ->20
    7    15    >   INIT_METHOD_CALL                                         !1, 'whereMetaIn'
         16        SEND_VAL_EX                                              'location'
         17        CAST                                          7  ~10     !2
         18        SEND_VAL_EX                                              ~10
         19        DO_FCALL                                      0          
    9    20    > > JMPZ                                                     !3, ->24
   10    21    >   INIT_METHOD_CALL                                         !1, 'withAnyTag'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0          
   12    24    >   INIT_METHOD_CALL                                         !1, 'get'
         25        DO_FCALL                                      0  $13     
         26        INIT_METHOD_CALL                                         $13, 'count'
         27        DO_FCALL                                      0  $14     
         28      > JMPZ                                                     $14, ->30
   13    29    >   ASSIGN                                                   !4, 'position'
   18    30    > > JMPZ_EX                                          ~16     !2, ->33
         31    >   BOOL_NOT                                         ~17     !4
         32        BOOL                                             ~16     ~17
         33    > > JMPZ                                                     ~16, ->55
   19    34    >   INIT_STATIC_METHOD_CALL                                  'Job', 'whereMetaIn'
         35        SEND_VAL_EX                                              'location'
         36        CAST                                          7  ~18     !2
         37        SEND_VAL_EX                                              ~18
         38        DO_FCALL                                      0  $19     
         39        ASSIGN                                                   !1, $19
   20    40        INIT_METHOD_CALL                                         !1, 'where'
         41        SEND_VAL_EX                                              'status'
         42        SEND_VAL_EX                                              '%3C'
         43        SEND_VAL_EX                                              2
         44        DO_FCALL                                      0          
   21    45      > JMPZ                                                     !3, ->49
   22    46    >   INIT_METHOD_CALL                                         !1, 'withAnyTag'
         47        SEND_VAR_EX                                              !3
         48        DO_FCALL                                      0          
   24    49    >   INIT_METHOD_CALL                                         !1, 'get'
         50        DO_FCALL                                      0  $23     
         51        INIT_METHOD_CALL                                         $23, 'count'
         52        DO_FCALL                                      0  $24     
         53      > JMPZ                                                     $24, ->55
   25    54    >   ASSIGN                                                   !4, 'location'
   27    55    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.31 ms | 1399 KiB | 13 Q