3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Initial settings:'.PHP_EOL; echo 'zend.assertions: '.ini_get('zend.assertions').PHP_EOL; echo 'assert.active: '.ini_get('assert.active').PHP_EOL; ini_set('zend.assertions', 0); assert_options(ASSERT_ACTIVE, 0); echo 'After altering settings:'.PHP_EOL; echo 'zend.assertions: '.ini_get('zend.assertions').PHP_EOL; echo 'assert.active: '.ini_get('assert.active').PHP_EOL; $assert = false; assert($assert = true); if($assert) echo 'Code in assert() was evaluated'.PHP_EOL; else echo 'Code in assert() was NOT evaluated'.PHP_EOL;
based on 0VkPp
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
Initial settings: zend.assertions: 1 assert.active: 1 After altering settings: zend.assertions: 0 assert.active: 0 Code in assert() was NOT evaluated
Output for 5.6.0 - 5.6.40
Initial settings: zend.assertions: assert.active: 1 After altering settings: zend.assertions: assert.active: 0 Code in assert() was evaluated