<?php
// This is not true/false bolean either.
var_dump( (bool) null );
// These do not directly correlate to boolean,
// i.e. they don't mean the same as boolean.
var_dump( (bool) array( false ) );
var_dump( (bool) new stdClass );
var_dump( (bool) 'This is an example string.' );
var_dump( (bool) static function() { return false; } ); // Anonmyous function: callback.
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_FUNCTION, expecting T_PAAMAYIM_NEKUDOTAYIM in /in/m5fBl on line 11
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Parse error: syntax error, unexpected T_STATIC in /in/m5fBl on line 11
Process exited with code 255.