repo stringlengths 7 63 | file_url stringlengths 81 284 | file_path stringlengths 5 200 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:02:33 2026-01-05 05:24:06 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
thecodeholic/Yii2-Youtube-Clone | https://github.com/thecodeholic/Yii2-Youtube-Clone/blob/d8d6c35890b5d3ebb00b0cc6ace20deea99974b1/environments/prod/frontend/config/params-local.php | environments/prod/frontend/config/params-local.php | <?php
return [
];
| php | BSD-3-Clause | d8d6c35890b5d3ebb00b0cc6ace20deea99974b1 | 2026-01-05T04:42:11.286050Z | false |
thecodeholic/Yii2-Youtube-Clone | https://github.com/thecodeholic/Yii2-Youtube-Clone/blob/d8d6c35890b5d3ebb00b0cc6ace20deea99974b1/environments/prod/frontend/config/main-local.php | environments/prod/frontend/config/main-local.php | <?php
return [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '',
],
],
];
| php | BSD-3-Clause | d8d6c35890b5d3ebb00b0cc6ace20deea99974b1 | 2026-01-05T04:42:11.286050Z | false |
thecodeholic/Yii2-Youtube-Clone | https://github.com/thecodeholic/Yii2-Youtube-Clone/blob/d8d6c35890b5d3ebb00b0cc6ace20deea99974b1/environments/prod/frontend/web/index.php | environments/prod/frontend/web/index.php | <?php
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
$conf... | php | BSD-3-Clause | d8d6c35890b5d3ebb00b0cc6ace20deea99974b1 | 2026-01-05T04:42:11.286050Z | false |
nmcteam/image-with-text | https://github.com/nmcteam/image-with-text/blob/51f6442d8d80278ddca5462f766de4477812aaf4/src/NMC/ImageWithText/Text.php | src/NMC/ImageWithText/Text.php | <?php
/**
* Image with Text
*
* @author Josh Lockhart <josh@newmediacampaigns.com>
* @copyright 2013 Josh Lockhart
* @link https://github.com/nmcteam/image-with-text
* @license MIT
* @version 2.0.2
*
* MIT LICENSE
*
* Permission is hereby granted, free of charge, to any person obtaining... | php | MIT | 51f6442d8d80278ddca5462f766de4477812aaf4 | 2026-01-05T04:42:19.903079Z | false |
nmcteam/image-with-text | https://github.com/nmcteam/image-with-text/blob/51f6442d8d80278ddca5462f766de4477812aaf4/src/NMC/ImageWithText/Image.php | src/NMC/ImageWithText/Image.php | <?php
/**
* Image with Text
*
* @author Josh Lockhart <josh@newmediacampaigns.com>
* @copyright 2013 Josh Lockhart
* @link https://github.com/nmcteam/image-with-text
* @license MIT
* @version 2.0.2
*
* MIT LICENSE
*
* Permission is hereby granted, free of charge, to any person obtaining... | php | MIT | 51f6442d8d80278ddca5462f766de4477812aaf4 | 2026-01-05T04:42:19.903079Z | false |
nmcteam/image-with-text | https://github.com/nmcteam/image-with-text/blob/51f6442d8d80278ddca5462f766de4477812aaf4/example/demo.php | example/demo.php | <?php
require '../vendor/autoload.php';
// Create image
$image = new \NMC\ImageWithText\Image(dirname(__FILE__) . '/source.jpg');
// Add styled text to image
$text1 = new \NMC\ImageWithText\Text('Thanks for using our image text PHP library!', 3, 25);
$text1->align = 'left';
$text1->color = 'FFFFFF';
$text1->font = di... | php | MIT | 51f6442d8d80278ddca5462f766de4477812aaf4 | 2026-01-05T04:42:19.903079Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/HaltCommand.php | src/HaltCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class HaltCommand extends Command
{
/**
* Configure the command options.
*
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/ResumeCommand.php | src/ResumeCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ResumeCommand extends Command
{
/**
* Configure the command options.
*... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/DestroyCommand.php | src/DestroyCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DestroyCommand extends Command
{
/**
* Configure the command options.
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/MakeCommand.php | src/MakeCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MakeCommand extends Command
{
/**
* The base path of the Laravel ... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/StatusCommand.php | src/StatusCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class StatusCommand extends Command
{
/**
* Configure the command options.
*... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/EditCommand.php | src/EditCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class EditCommand extends Command
{
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/ProvisionCommand.php | src/ProvisionCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ProvisionCommand extends Command
{
/**
* Configure the command options.
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/UpCommand.php | src/UpCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class UpCommand extends Command
{
/**... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/SuspendCommand.php | src/SuspendCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SuspendCommand extends Command
{
/**
* Configure the command options.
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/SshCommand.php | src/SshCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SshCommand extends Command
{
/**
* Configure the command options.
*
* @return void
*/
protected... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/AddSiteCommand.php | src/AddSiteCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Yaml;
class AddSiteCommand extends Command
{
/*... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/SshConfigCommand.php | src/SshConfigCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SshConfigCommand extends Command
{
/**
* Configure the command options.
*
* @return void
*/
pro... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/AddDatabaseCommand.php | src/AddDatabaseCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Yaml\Yaml;
class AddDatabaseCommand extends Command
{
... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/UpdateCommand.php | src/UpdateCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Process\Process;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class UpdateCommand extends Command
{
/**
* Configure the command options.
*... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/RunCommand.php | src/RunCommand.php | <?php
namespace Laravel\Homestead;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class RunCommand extends Command
{
/**
* Configure the command option... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
Swader/homestead_improved | https://github.com/Swader/homestead_improved/blob/efa9968eb4f6fddca1611841867a1cc083c8ac59/src/InitCommand.php | src/InitCommand.php | <?php
namespace Laravel\Homestead;
use InvalidArgumentException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class InitCommand extends Command
{
/**
* Configure the command options.
*
* @re... | php | MIT | efa9968eb4f6fddca1611841867a1cc083c8ac59 | 2026-01-05T04:42:23.201809Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/ClickhouseServiceProvider.php | src/ClickhouseServiceProvider.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse;
use ClickHouseDB\Client as... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Migration/MigrationCreator.php | src/Migration/MigrationCreator.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Migration;
use Illuminate\F... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Migration/MigrationRepository.php | src/Migration/MigrationRepository.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Migration;
use ClickHouseDB... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Migration/Migrator.php | src/Migration/Migrator.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Migration;
use ClickHouseDB... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Migration/AbstractClickhouseMigration.php | src/Migration/AbstractClickhouseMigration.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Migration;
use ClickHouseDB... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Exception/ClickhouseConfigException.php | src/Exception/ClickhouseConfigException.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Exception;
use Exception;
... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/ConsoleCommand/MakeClickhouseMigrationCommand.php | src/ConsoleCommand/MakeClickhouseMigrationCommand.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\ConsoleCommand;
use Cog\Lar... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/ConsoleCommand/ClickhouseMigrateCommand.php | src/ConsoleCommand/ClickhouseMigrateCommand.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\ConsoleCommand;
use Cog\Lar... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/src/Factory/ClickhouseClientFactory.php | src/Factory/ClickhouseClientFactory.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Laravel\Clickhouse\Factory;
use ClickHouseDB\C... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/tests/AbstractTestCase.php | tests/AbstractTestCase.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Tests\Laravel\Clickhouse;
use Cog\Laravel\Clic... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/tests/Factory/ClickhouseClientFactoryTest.php | tests/Factory/ClickhouseClientFactoryTest.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Cog\Tests\Laravel\Clickhouse\Factory;
use Cog\Lara... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
cybercog/laravel-clickhouse | https://github.com/cybercog/laravel-clickhouse/blob/7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5/config/clickhouse.php | config/clickhouse.php | <?php
/*
* This file is part of Laravel ClickHouse.
*
* (c) Anton Komarev <anton@komarev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
return [
/*
|---------------------------------------... | php | MIT | 7b7aa5eb856c9d94ca450b7c7ff45d7a8a1381c5 | 2026-01-05T04:42:27.179183Z | false |
alexpechkarev/geometry-library | https://github.com/alexpechkarev/geometry-library/blob/35839ed841805c8a0bc2fd8e4d5b5f600cb1416a/SphericalUtil.php | SphericalUtil.php | <?php namespace GeometryLibrary;
/*
* Copyright 2013 Google Inc.
* https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/SphericalUtil.java
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... | php | MIT | 35839ed841805c8a0bc2fd8e4d5b5f600cb1416a | 2026-01-05T04:42:33.180245Z | false |
alexpechkarev/geometry-library | https://github.com/alexpechkarev/geometry-library/blob/35839ed841805c8a0bc2fd8e4d5b5f600cb1416a/PolyUtil.php | PolyUtil.php | <?php namespace GeometryLibrary;
/*
* Copyright 2013 Google Inc.
*
* https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/PolyUtil.java
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... | php | MIT | 35839ed841805c8a0bc2fd8e4d5b5f600cb1416a | 2026-01-05T04:42:33.180245Z | false |
alexpechkarev/geometry-library | https://github.com/alexpechkarev/geometry-library/blob/35839ed841805c8a0bc2fd8e4d5b5f600cb1416a/MathUtil.php | MathUtil.php | <?php namespace GeometryLibrary;
/*
* Copyright 2013 Google Inc.
* https://github.com/googlemaps/android-maps-utils/blob/master/library/src/com/google/maps/android/MathUtil.java
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Y... | php | MIT | 35839ed841805c8a0bc2fd8e4d5b5f600cb1416a | 2026-01-05T04:42:33.180245Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/8.php | Chapter08/8.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class TreeNode {
public $data = NULL;
public $children = [];
public function __construct(string $data = NULL) {
$this->data = $data;
}
public function addChildre... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/4.php | Chapter08/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function repetitiveBinarySearch(array $numbers, int $neeedle): int {
$low = 0;
$high = count($numbers) - 1;
$firstOccurrence = -1;
while ($low <= $high) {
$mid = (int... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/6.php | Chapter08/6.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function binarySearch(array $numbers, int $neeedle, int $low, int $high): int {
if ($high < $low) {
return -1;
}
$mid = (int) (($low + $high) / 2);
if ($numbers[$mid]... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/9.php | Chapter08/9.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class TreeNode {
public $data = NULL;
public $children = [];
public function __construct(string $data = NULL) {
$this->data = $data;
}
public function addChildre... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/7.php | Chapter08/7.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$arr = [];
$count = rand(10, 30);
for($i = 0; $i<$count;$i++) {
$val = rand(1,500);
$arr[$val] = $val;
}
$number = 100;
if(isset($arr[$number])) {
echo "$numb... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/10.php | Chapter08/10.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class TreeNode {
public $data = NULL;
public $children = [];
public function __construct(string $data = NULL) {
$this->data = $data;
}
public function addChildre... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/5.php | Chapter08/5.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function interpolationSearch(array $arr, int $key): int {
$low = 0;
$high = count($arr) - 1;
while ($arr[$high] != $arr[$low] && $key >= $arr[$low] && $key <= $arr[$high]) ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/3.php | Chapter08/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function binarySearch(array $numbers, int $neeedle, int $low, int $high): int {
if ($high < $low) {
return -1;
}
$mid = (int) (($low + $high) / 2);
if ($numbers[$mid]... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/1.php | Chapter08/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function search(array $numbers, int $neeedle): bool {
$totalItems = count($numbers);
for ($i = 0; $i < $totalItems; $i++) {
if($numbers[$i] === $neeedle){
return TRUE;
}... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter08/2.php | Chapter08/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function binarySearch(array $numbers, int $neeedle): bool {
$low = 0;
$high = count($numbers)-1;
while ($low <= $high) {
$mid = (int) (($low + $high) / 2);
if ($numbers[... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/8.php | Chapter04/8.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public $priority = NULL;
public function __construct(string $data = NULL, int $priority = NULL) {
$this->d... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/4.php | Chapter04/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function expressionChecker(string $expression): bool {
$valid = TRUE;
$stack = new SplStack();
for ($i = 0; $i < strlen($expression); $i++) {
$char = substr($expression, $i... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/6.php | Chapter04/6.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
}
class LinkedList impl... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/11.php | Chapter04/11.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
}
class LinkedList impl... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/9.php | Chapter04/9.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class MyPQ extends SplPriorityQueue {
public function compare($priority1, $priority2) {
return $priority1 <=> $priority2;
}
}
$agents = new MyPQ();
$agents->insert("Fred", ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/7.php | Chapter04/7.php | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$agents = new SplQueue();
$agents->enqueue("Fred");
$agents->enqueue("John");
$agents->enqueue("Keith");
$agents->enqueue("Adiy... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/10.php | Chapter04/10.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
interface Queue {
public function enqueue(string $item);
public function dequeue();
public function peek();
public function isEmpty();
}
class CircularQueue impleme... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/5.php | Chapter04/5.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
interface Queue {
public function enqueue(string $item);
public function dequeue();
public function peek();
public function isEmpty();
}
class AgentQueue implements... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/3.php | Chapter04/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$books = new SplStack();
$books->push("Introduction to PHP7");
$books->push("Mastering JavaScript");
$books->push("MySQL Workbench tutorial");
echo $books->pop() . "\n";
echo $books->top... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/1.php | Chapter04/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
interface Stack {
public function push(string $item);
public function pop();
public function top();
public function isEmpty();
}
class Books implements Stack {
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter04/2.php | Chapter04/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
}
class LinkedList imple... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/4.php | Chapter06/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class Node {
public $data;
public $left;
public $right;
public function __construct(int $data = NULL) {
$this->data = $data;
$this->left = NULL;
$this->right = NULL... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/6.php | Chapter06/6.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class Node {
public $data;
public $left;
public $right;
public $parent;
public function __construct(int $data = NULL, Node $parent = NULL) {
$this->data = $data;
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/5.php | Chapter06/5.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class Node {
public $data;
public $left;
public $right;
public $parent;
public function __construct(int $data = NULL, Node $parent = NULL) {
$this->data = $data;
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/3.php | Chapter06/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class BinaryTree {
public $nodes = [];
public function __construct(Array $nodes) {
$this->nodes = $nodes;
}
public function traverse(int $num = 0, int $level = 0) {
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/1.php | Chapter06/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class TreeNode {
public $data = NULL;
public $children = [];
public function __construct(string $data = NULL) {
$this->data = $data;
}
public function addChildre... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter06/2.php | Chapter06/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class BinaryNode {
public $data;
public $left;
public $right;
public function __construct(string $data = NULL) {
$this->data = $data;
$this->left = NULL;
$this->rig... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter02/1.php | Chapter02/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$array = [1,2,3,4,5];
$mixedArray = [];
$mixedArray[0] = 200;
$mixedArray['name'] = "Mixed array";
$mixedArray[1] = 10.65;
$mixedArray[2] = ['I', 'am', 'another', 'array'];
$array = ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter02/2.php | Chapter02/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$startMemory = memory_get_usage();
$array = new SplFixedArray(100);
for ($i = 0; $i < 100; $i++)
$array[$i] = new SplFixedArray(100);
echo memory_get_usage() - $startMemory, '... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/4.php | Chapter13/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
require __DIR__ . '/vendor/autoload.php';
use Tarsana\Functional as F;
$queue = [];
$enqueue = F\append(F\__(), F\__());
$head = F\head(F\__());
$dequeue = F\tail(F\__());
$queue = $... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/5.php | Chapter13/5.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function treeTraverse(array &$tree, int $index = 0, int $level = 0, &$outputStr = "") : ?bool {
if(isset($tree[$index])) {
$outputStr .= str_repeat("-", $level);
$... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/3.php | Chapter13/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
require __DIR__ . '/vendor/autoload.php';
use Tarsana\Functional as F;
$stack = [];
$push = F\append(F\__(), F\__());
$top = F\last(F\__());
$pop = F\init(F\__());
$stack = $push(1, ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/1.php | Chapter13/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$languages = ["php", "python", "java", "c", "erlang"];
foreach ($languages as $ind => $language) {
$languages[$ind] = ucfirst($language);
}
$languages = array_map('ucfirst', $lang... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/2.php | Chapter13/2.php | <?php
/**
* Created by PhpStorm.
* User: mizan
* Date: 25/04/17
* Time: 10:58 AM
*/
require __DIR__ . '/vendor/autoload.php';
use Tarsana\Functional as F;
$add = F\curry(function($x, $y, $z) {
return $x + $y + $z;
});
echo $add(1, 2, 4)."\n";
$addFive = $add(5);
$addSix = $addFive(6);
echo $addSix(2);
$r... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/autoload.php | Chapter13/vendor/autoload.php | <?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit162d5f8ec26d0f35f7a435b58f506e91::getLoader();
| php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_files.php | Chapter13/vendor/composer/autoload_files.php | <?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'ad301e9d734a656b3a7e0cfda5d86814' => $vendorDir . '/tarsana/functional/src/Internal/_functions.php',
'074162fde8cc05bb516fe2da4bdde1e2' => $vendorDir . '/tarsana/function... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_real.php | Chapter13/vendor/composer/autoload_real.php | <?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit162d5f8ec26d0f35f7a435b58f506e91
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_namespaces.php | Chapter13/vendor/composer/autoload_namespaces.php | <?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
| php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_psr4.php | Chapter13/vendor/composer/autoload_psr4.php | <?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Tarsana\\UnitTests\\Functional\\' => array($vendorDir . '/tarsana/functional/tests'),
'Tarsana\\Functional\\' => array($vendorDir . '/tarsana/functional/src/Classes'),
);
| php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_static.php | Chapter13/vendor/composer/autoload_static.php | <?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit162d5f8ec26d0f35f7a435b58f506e91
{
public static $files = array (
'ad301e9d734a656b3a7e0cfda5d86814' => __DIR__ . '/..' . '/tarsana/functional/src/Internal/_functions.php',
'074162fde8cc05bb51... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/ClassLoader.php | Chapter13/vendor/composer/ClassLoader.php | <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader im... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/composer/autoload_classmap.php | Chapter13/vendor/composer/autoload_classmap.php | <?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
| php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter13/vendor/tarsana/functional/build.php | Chapter13/vendor/tarsana/functional/build.php | <?php namespace Tarsana\Functional;
/**
* This script parses the source files using [dox](https://github.com/tj/dox)
* and generates the unit tests and documentation files.
*/
require __DIR__ . '/vendor/autoload.php';
/**
* Custom Types:
* DoxBlock :: {
* tags: [{
* type: String,
* string:... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/8.php | Chapter05/8.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$path = realpath('.');
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
foreach ($files as $name => $file) {
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/4.php | Chapter05/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$dsn = "mysql:host=127.0.0.1;port=3306;dbname=packt;charset=UTF8;";
$username = "root";
$password = "";
$dbh = new PDO($dsn, $username, $password);
$result = $dbh->query("Select * from... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/6.php | Chapter05/6.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function showFiles(string $dirName, Array &$allFiles = []) {
$files = scandir($dirName);
foreach ($files as $key => $value) {
$path = realpath($dirName . DIRECTORY_SEPARATOR . ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/9.php | Chapter05/9.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$teams = array(
'Popular Football Teams',
array(
'La Lega',
array('Real Madrid', 'FC Barcelona', 'Athletico Madrid', 'Real Betis', 'Osasuna')
),
array(
'English Premi... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/7.php | Chapter05/7.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function maxDepth() {
static $i = 0;
print ++$i . "\n";
return 1+maxDepth();
}
maxDepth();
| php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/10.php | Chapter05/10.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function array_sum_recursive(Array $array) {
$sum = 0;
array_walk_recursive($array, function($v) use (&$sum) {
$sum += $v;
});
return $sum;
}
$arr = [1, 2, 3, 4, 5, [... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/5.php | Chapter05/5.php | <head>
<style>
ul {
list-style: none;
clear: both;
}
li ul {
margin: 0px 0px 0px 50px;
}
.pic {
display: block;
width: 50px;
height: 50px;
float: left;
color: #000;
background: #ADDFEE;
padding: 15px 10px;
text-align: center;
margin-right: 20px;
}
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/3.php | Chapter05/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function gcd(int $a, int $b): int {
if ($b == 0) {
return $a;
} else {
return gcd($b, $a % $b);
}
}
echo gcd(259,111); | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/1.php | Chapter05/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function factorialx(int $n): int {
if ($n == 1)
return 1;
return $n * factorial($n - 1);
}
function factorial(int $n): int {
$result = 1;
for ($i = $n; $i > 0; $i--)... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter05/2.php | Chapter05/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function fibonacci(int $n): int {
if($n == 0) {
return 1;
} else if($n == 1) {
return 1;
} else {
return fibonacci($n-1) + fibonacci($n-2);
}
}
echo fibonacci(20); | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter12/3.php | Chapter12/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$a = new \Ds\Vector([1, 2, 3]);
$b = $a->copy();
$b->push(4);
print_r($a);
print_r($b);
$vector = new \Ds\Vector(["a", "b", "c"]);
echo $vector->get(1)."\n";
$vector[1] = "d";
echo $... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter12/1.php | Chapter12/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$inputStr = 'Bingo';
$fruites = ['Apple', 'Orange', 'Grapes', 'Banana', 'Water melon', 'Mango'];
$matchScore = -1;
$matchedStr = '';
foreach ($fruites as $fruit) {
$tmpScore = lev... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter12/2.php | Chapter12/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$countries = [];
array_push($countries, 'Bangladesh', 'Bhutan');
$countries = ["Bangladesh", "Nepal", "Bhutan"];
$key = array_search("Bangladesh", $countries);
if ($key !== FALSE)
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter03/4.php | Chapter03/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
$BookTitles = new SplDoublyLinkedList();
$BookTitles->push("Introduction to Algorithm");
$BookTitles->push("Introduction to PHP and Data structures");
$BookTitles->push("Programming In... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter03/3.php | Chapter03/3.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public $prev = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter03/1.php | Chapter03/1.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
}
class LinkedList imple... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter03/2.php | Chapter03/2.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
class ListNode {
public $data = NULL;
public $next = NULL;
public function __construct(string $data = NULL) {
$this->data = $data;
}
}
class CircularLinkedLi... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter11/8.php | Chapter11/8.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
define("GC", "-");
define("SP", 1);
define("GP", -1);
define("MS", -1);
function NWSquencing(string $s1, string $s2) {
$grid = [];
$M = strlen($s1);
$N = strlen($s2);
... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter11/4.php | Chapter11/4.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function huffmanEncode(array $symbols): array {
$heap = new SplPriorityQueue;
$heap->setExtractFlags(SplPriorityQueue::EXTR_BOTH);
foreach ($symbols as $symbol => $weight) ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
PacktPublishing/PHP7-Data-Structures-and-Algorithms | https://github.com/PacktPublishing/PHP7-Data-Structures-and-Algorithms/blob/d5f228ce95b3c09fb173cd3243893ff658384d67/Chapter11/6.php | Chapter11/6.php | <?php
/*
* Example code for: PHP 7 Data Structures and Algorithms
*
* Author: Mizanur rahman <mizanur.rahman@gmail.com>
*
*/
function knapSack(int $maxWeight, array $weights, array $values, int $n) {
$DP = [];
for ($i = 0; $i <= $n; $i++) {
for ($w = 0; $w <= $maxWeight; $w++) {
if ($i == 0 || ... | php | MIT | d5f228ce95b3c09fb173cd3243893ff658384d67 | 2026-01-05T04:42:44.302062Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.