Pest PHP source
composer require pestphp/pest --dev --with-all-dependencies
composer require pestphp/pest-plugin-laravel --dev
php artisan pest:install
<?php | |
function selectionSort(array $a): array | |
{ | |
for ($i = 0; $i < count($a) - 1; $i++) { | |
$min_i = $i; | |
for ($j = $i + 1; $j < count($a); $j++) { | |
if ($a[$j] < $a[$min_i]) { | |
$min_i = $j; | |
} |
<?php | |
function bubbleSort(array $a): array | |
{ | |
for ($i = count($a) - 1; $i > 0; $i--) { | |
for ($j = 0; $j < $i; $j++) { | |
if ($a[$j] > $a[$j + 1]) { | |
$temp = $a[$j]; | |
$a[$j] = $a[$j+1]; | |
$a[$j+1] = $temp; |
<?php | |
class Node | |
{ | |
public $value; | |
public $next; | |
public function __construct($value) | |
{ | |
$this->value = $value; |
<?php | |
class Node | |
{ | |
public $value; | |
public $next; | |
public function __construct($value) | |
{ | |
$this->value = $value; |
<?php | |
class Node | |
{ | |
public $value; | |
public $next; | |
public $prev; | |
public function __construct($value) | |
{ |
<?php | |
class Node | |
{ | |
public $value; | |
public $next; | |
public function __construct($value) | |
{ | |
$this->value = $value; |
composer require pestphp/pest --dev --with-all-dependencies
composer require pestphp/pest-plugin-laravel --dev
php artisan pest:install
# SED replace all html tags | |
sed -e 's/<[^>]*>//g' | |
# SED multiple divided by ; | |
sed 's/ab/~/g; s/bc/ab/g; s/~/bc/g' | |
# SED delete empty lines | |
sed '/^\s*$/d' | |
# SED delete all lines except pattern |