Anti blockchain p2p programmer and freelance and all‐rounder.
embeded, frontend, backend, infrastructure(on cloud), application, a part‐time lecturer..etc
https://kyorohiro.gitbook.io/home/
More than 40 years of software development, software architect, team leader, speaker and PHP evangelist. Currently working for CCMBenchmark Group company.
Programmierer aus Leidenschaft. Ich lege besonders Wert auf Clean Code und liebe es mich durch legacy Code zu wühlen... und den dann zu refaktorieren 😉.
From a performance perspective on server side, Dart is ahead of PHP:
Sample:
wrk http://localhost:1337 -c 8 -d 60 -t 8
/// Dartimport'dart:io';Futuremain()async{varserver=awaitHttpServer.bind(InternetAddress.loopbackIPv4,1337,);print('Listening on localhost:${server.port}');awaitfor(HttpRequestrequestinserver){request.response.write('Hello World');awaitrequest.response.close();}}
<?php
use Swoole\Http\Server;
use Swoole\Http\Request;
use Swoole\Http\Response;
$server = new Swoole\HTTP\Server("127.0.0.1", 9501);
$server->on("start", function (Server $server) {
echo "Awesomeness of PHP has been initialized\n";
});
$server->on("request", function (Request $request, Response $response) {
$response->header("Content-Type", "text/plain");
$response->end("Hello Philippines!\n");
});
$server->start();
More than 40 years of software development, software architect, team leader, speaker and PHP evangelist. Currently working for CCMBenchmark Group company.
Top comments (6)
If for a small job, I choice PHP.
Because, PHP has many developer, and useful framework for web.We can do fast develop and fast release at PHP.
If for my project, I choice Dart.
Because, Dart is easy to develop web service by strong type and smart editors and IDE.
where i can find good tutorial for dart lang? thank you :)
PHP is designed for app on server side, and Dart for app on client side. So, use both.
From a performance perspective on server side, Dart is ahead of PHP:
Sample:
Looks very interesting, I think I should give it a try 🙂
How about this...
yes, but PHP is more simple (just 2 lines), so it's better for newbies, simple to edit, to maintain, etc. :)