How to protect PHP source Code?

When to keep your PHP code logic secret? Whenever you need to pass a script to a client, but you are afraid that it will get copied and reused elsewhere without your permission. How to protect your PHP code? You could implement code “blockers”. Provide a...

PHP Linked List with end and start List Node pointers

<?php class ListNode { public $data = NULL; public $next = NULL; function __construct(string $data = NULL) { $this->data = $data; } } class LinkedList { private $_firstNode = NULL; private $_lastNode = NULL; private $_totalNodes = 0; function insert(string $data =...

PHP float number not add up

Why my numbers are not equal PHP? Floating point precision Floating point numbers have limited precision. Although it depends on the system, PHP typically uses the IEEE 754 double precision format, which will give a maximum relative error due to rounding in the order...

Division in PHP

Do we still need intdiv() since PHP 8.0 / operator supports error throwing when dividing by 0? intdiv(10, 3) == 3;intdiv(-10, 3) == -3; (int)(10 / 3) == 3;(int)(-10 / 3) == -3; floor(10/3) == 3;floor(-10/3) == -4; <?php $start1 = microtime(true); $i = 1; while ($i...