This file contains hidden or 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 | |
class A { | |
private $omg = 'A'; | |
function dump() { | |
return get_object_vars($this); | |
} | |
} |
This file contains hidden or 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 | |
function dont_give_me_five(int $start, int $end): int | |
{ | |
$start_multiple = $start < 0 ? -1 : 1; | |
$end_multiple = $end < 0 ? -1 : 1; | |
$zero_value = (int)( | |
$start_multiple !== $end_multiple | |
|| false === strpos((string)min(abs($start), abs($end)), '5') | |
); |
This file contains hidden or 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); | |
class DoubleLinkedException extends \Exception | |
{ | |
} | |
class WrongNameDoubleLinkedException extends DoubleLinkedException | |
{ | |
} |
This file contains hidden or 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 | |
// https://3v4l.org/0Fonp | |
$x = 1.999999999999999; | |
$y = 2; | |
var_dump([ | |
'float: 1.999999999999999' => [ | |
'serilize' => [$x, 'orig' => serialize($x), 'int' => serialize((int)$x), 'round' => serialize(round($x)), $x < 2], | |
'int' => [(int)$x, (int)$x < 2], | |
'string'=>[(string)$x, (string)$x < 2], |
This file contains hidden or 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); | |
final class A { | |
private $prop; | |
public function __construct(DateTime $prop) { $this->prop = $prop; } | |
public function getProp() { return $this->prop; } | |
} | |
$a = new A(new DateTime()); |
NewerOlder