3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (count($sections) > 0): ?> <div class="photo-gallery-box"> <div class="photo-gallery in-view-checker"> <?php $class = ' active'; foreach ($sections as $section): ?> <div class="screen<?php echo $class; ?>"> <?php if (!empty($section['big'])): ?> <div class="side"> <div class="item responsimg" data-responsimg870="<?= $section['big'][0]['image'] ?>" data-responsimg10="<?= $section['big'][0]['image'] ?>" data-gallery="<?= $section['big'][0]['id'] ?>"> <div class="description"> <div class="sub-box"> <div class="align-m"> <img src="<?= Url::base() ?>/uploads/photo-icon.png" class="icon" alt="" /> <h3><?= $section['big'][0]['title'] ?></h3> <p><?= $section['big'][0]['description'] ?></p> </div> </div> </div> </div> </div> <?php endif; ?> <?php if (count($section['small']) > 0): ?> <div class="side half"> <?php foreach ($section['small'] as $small_album): ?> <div class="item responsimg" data-responsimg870="<?= $small_album['image'] ?>" data-responsimg10="<?= $small_album['image'] ?>" data-gallery="<?= $small_album['id'] ?>"> <div class="description"> <div class="sub-box"> <div class="align-m"> <img src="<?= Url::base() ?>/uploads/photo-icon.png" class="icon" alt="" /> <h3><?= $small_album['title'] ?></h3> <p><?= $small_album['description'] ?></p> </div> </div> </div> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> <?php $class = ''; endforeach; ?> </div> <ul class="sub-gallery"> </ul> </div> </div> <?php endif; ?>
Output for 8.0.10 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $sections in /in/N34u2 on line 2 Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/N34u2:2 Stack trace: #0 {main} thrown in /in/N34u2 on line 2
Process exited with code 255.
Output for 8.0.0 - 8.0.9
Warning: Undefined variable $sections in /in/N34u2 on line 2 Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in /in/N34u2:2 Stack trace: #0 {main} thrown in /in/N34u2 on line 2
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined variable: sections in /in/N34u2 on line 2 Warning: count(): Parameter must be an array or an object that implements Countable in /in/N34u2 on line 2
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: count(): Parameter must be an array or an object that implements Countable in /in/N34u2 on line 2
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Notice: Undefined variable: sections in /in/N34u2 on line 2

preferences:
165.2 ms | 401 KiB | 211 Q