Created
June 26, 2019 07:16
-
-
Save jasny/eacd187c949459b70d8f8f0818411f0a to your computer and use it in GitHub Desktop.
Proof of concept where `strict_types` affects `==` and `!=` operators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
var_dump("1" == 1); | |
var_dump("1" != 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
var_dump("1" == 1); | |
var_dump("1" != 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Test for https://github.com/jasny/php-src/tree/strict_types-affect-operators-test | |
echo "== STANDARD ==\n"; | |
include 'poc-standard.php'; | |
echo "\n"; | |
echo "== STRICT ==\n"; | |
require 'poc-strict.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment