aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blanquine.php58
-rw-r--r--src/countup-quine.php1
-rw-r--r--src/illegal-quine.php1
-rw-r--r--src/illegal-quine2.php1
-rw-r--r--src/quine-japan.php9
-rw-r--r--src/quine-puzzle.php50
-rw-r--r--src/simple.php1
-rw-r--r--src/try-quine.php1
-rw-r--r--src/try-quine2.php1
-rw-r--r--src/try-quine3.php1
-rw-r--r--src/try-quine4.php1
-rw-r--r--src/try-quine5.php1
-rw-r--r--src/try-quine6.php1
13 files changed, 127 insertions, 0 deletions
diff --git a/src/blanquine.php b/src/blanquine.php
new file mode 100644
index 0000000..a93bee0
--- /dev/null
+++ b/src/blanquine.php
@@ -0,0 +1,58 @@
+ <?eval(
+ preg_replace
+ ("/\s/" ,"",$s='
+ printf( "<?eval
+ (\n%spr eg_repl
+ ace\n%s (\"/\s/
+ \"%s,\" \",\$s=
+ %c%s%c) );\n",(
+ $r="str _repeat
+ ")($w=c hr(32),
+ 28),$r( $w,26),
+ $w,39,$ s,39);/*printf("<?eval(\n%spreg_re place\n
+ %s(\"/\ s/\"%s,\"\",\$s=%c%s%c));\n",($r=" str_rep
+ eat")($ w=chr(32),28),$r($w,26),$w,39,$s,3 9);prin
+ tf("<?e
+ val(\n%
+ spreg_r
+ eplace\n%s(\"/\s/\"%s,\"\",\$s=%c%s%c));\n",($r="
+ str_repeat")($w=chr(32),28),$r($w,26),$w,39,$s,39
+ );printf("<?eval(\n%spreg_replace\n%s(\"/\s/\"%s,
+ \"\",\$
+ s=%c%s% c));\n" ,($r="s
+ tr_repe at")($w =chr(32
+ ),28),$ r($w,26 ),$w,39
+ ,$s,39) ;printf("<?eva l(\n%sp
+ reg_rep lace\n%s(\" /\s/\"%
+ s,\"\", \$s=%c%s %c));\n
+ ",($r=" str_r epeat")
+
+
+
+ ($w=chr
+ (32),28
+ ),$r($w
+ ,26),$w
+ ,39,$s,
+ 39);pri
+ ntf("<?
+ eval(\n%spreg_replace\n%s(\"/\s/\"%s,\"
+ \",\$s=%c%s%c));\n",($r="str_repeat")($
+ w=chr(32),28),$r($w,26),$w,39,$s,39);pr
+ intf("<?eval(\n%spreg_replace\n%s(\"/\s
+ /\"%s,\ "\",\$s
+ =%c%s%c ));\n",
+ ($r="st r_repea
+ t")($w= chr(32)
+ ,28),$r($w,26),$w,39,$s,39);printf("<?e
+ val(\n%spreg_replace\n%s(\"/\s/\"%s,\"\
+ ",\$s=%c%s%c));\n",($r="str_repeat")($w
+ =chr(32),28),$r($w,26),$w,39,$s,39);pri
+ ntf("<? eval(\n
+ %spreg_ replace
+ \n%s(\" /\s/\"%
+ s,\"\", \$s=%c%
+ s%c));\n",($r="str_repeat")($w=chr(32),
+ 28),$r($w,26),$w,39,$s,39);printf("<?ev
+ al(\n%spreg_replace\n%s(\"/\s/\"%s,\"\"
+ ,\$s=%c%s%c));\n",($r="str_repeat*/'));
diff --git a/src/countup-quine.php b/src/countup-quine.php
new file mode 100644
index 0000000..67352a9
--- /dev/null
+++ b/src/countup-quine.php
@@ -0,0 +1 @@
+<?$n=0;eval($s='printf("<?\$n=%d;eval(\$s=%c%s%c);\n",$n+1,39,$s,39);');
diff --git a/src/illegal-quine.php b/src/illegal-quine.php
new file mode 100644
index 0000000..5099558
--- /dev/null
+++ b/src/illegal-quine.php
@@ -0,0 +1 @@
+Hello, PHPerKaigi!
diff --git a/src/illegal-quine2.php b/src/illegal-quine2.php
new file mode 100644
index 0000000..b88fb91
--- /dev/null
+++ b/src/illegal-quine2.php
@@ -0,0 +1 @@
+<?echo file_get_contents(__FILE__);
diff --git a/src/quine-japan.php b/src/quine-japan.php
new file mode 100644
index 0000000..091a502
--- /dev/null
+++ b/src/quine-japan.php
@@ -0,0 +1,9 @@
+<?eval(preg_replace("/\s/","",$s='
+p r
+i ntf(" <
+? eval(pr e
+g _replace( \
+" /\s/\", \
+" \",\$ s
+= %
+c%s%c));\n",047,$s,047,39,39);'));
diff --git a/src/quine-puzzle.php b/src/quine-puzzle.php
new file mode 100644
index 0000000..996624f
--- /dev/null
+++ b/src/quine-puzzle.php
@@ -0,0 +1,50 @@
+<?php $z='bcdefghia';eval($s=strtr('$M="array_map";$S="st
+r_split";$C="chr";$zp=strpos($z,"a");[$dx,$dy]=match($arg
+v[1 ]?? nul l){
+"h" =>[ 1,0 ],"
+j"= >[0 ,-1 ],"k"=>[0 ,1] ,"l"=>[-1 ,0]
+,de fau lt= >[0,0],}; $zx =$zp%3;$z y=i
+ntd iv( $zp ,3) ;$s x=$ zx+
+$dx ;$s y=$ zy+ $dy ;if ($s
+x<0 ||2 <$s x)$sx=$zx ;if ($sy<0||2 <$s
+y)$ sy= $zy ;$sp=$sy* 3+$ sx;[$z[$s p],
+$z[ $zp ]]= [$z [$z p], $z[
+$sp ]]; ech o(" <?p hp" .$C
+(32 ).$ C(3 6)."z=".$ C(3 9).$z.$C( 39)
+."; eva l(" .$C(36)." s=s trtr(".$C (39
+)); $n= $M( $S,
+$S( "00 000 111
+1141424414143341142414424344111143434",5));$m=$M($S,$S("0
+00001100101111",3));$i=(new("ArrayObject")($S($s."//".$s,
+))) ->g etI ter
+ato r() ;$B =fn
+($_ =1) =>$ M(f n()=>prin t([ $i->curre nt(
+),$ i-> nex t() ][0]),ran ge( 1,$_*3)); $W=
+fn( $_= 1)= >pr int (st r_r epe
+at( $C( 32) ,$_ *3) );$ N=f n()
+=>p rint($C(1 0)) ;$B(7);$N (); for($y=0; $y<
+3;$ y++){$B(1 9); $N();$B() ;$W (5);$B(); $W(
+5); $B( );$ W(5 );$ B() ;$N ();
+$B( );$ W(5 );$ B() ;$W (5) ;$B
+(); $W( 5); $B();$N() ;fo r($l=0;$l <10
+;$l ++) {$B ();for($x =0; $x<3;$x++ ){$
+W(1 );$ M(f n($
+_)= >$_ ?$B ():
+$W(),$m[$n[$M("ord",$S($z))[$y*3+$x]-97][intdiv($l,2)]]);
+$W(1);$B();}$N();}$B();$W(5);$B();$W(5);$B();$W(5);$B();$
+N() ;$B (); $W(
+5); $B( );$ W(5
+);$ B();$W(5) ;$B ();$N();$ B(1 9);
+$N( );}$B(9); ech o($C(39). ",[ $C(
+32) =>" .$C (34 ).$ C(3 4).
+",$ C(1 0)= >". $C( 34) .$C
+(34 )." ])) ;");//$M= "ar ray
+_ma p"; $S= "str_spli t"; $C=
+"ch r"; $zp =st rpo s($ z,"
+a") ;[$ dx, $dy ]=m atc h($
+arg v[1 ]?? null){"h" =>[ 1,0
+]," j"= >[0 ,-1],"k"= >[0 ,1]
+,"l "=> [-1 ,0]
+,de fau lt= >[0
+,0],};$zx=$zp%3;$zy=intdiv($zp,3);$sx=$zx+$dx;$sy=$zy+//$
+M="array_map";$S="str_split',[chr(32)=>"",chr(10)=>""])); \ No newline at end of file
diff --git a/src/simple.php b/src/simple.php
new file mode 100644
index 0000000..5dd598e
--- /dev/null
+++ b/src/simple.php
@@ -0,0 +1 @@
+<?eval($s='printf("<?eval(\$s=%c%s%c);\n",39,$s,39);');
diff --git a/src/try-quine.php b/src/try-quine.php
new file mode 100644
index 0000000..4d4dc7a
--- /dev/null
+++ b/src/try-quine.php
@@ -0,0 +1 @@
+<?php echo '...';
diff --git a/src/try-quine2.php b/src/try-quine2.php
new file mode 100644
index 0000000..f640322
--- /dev/null
+++ b/src/try-quine2.php
@@ -0,0 +1 @@
+<?php echo '<?php echo \'...\';';
diff --git a/src/try-quine3.php b/src/try-quine3.php
new file mode 100644
index 0000000..4136afa
--- /dev/null
+++ b/src/try-quine3.php
@@ -0,0 +1 @@
+<?php echo '<?php echo \'<?php echo \'<?php echo \\\'...\\\';\';\';';
diff --git a/src/try-quine4.php b/src/try-quine4.php
new file mode 100644
index 0000000..ad90e7f
--- /dev/null
+++ b/src/try-quine4.php
@@ -0,0 +1 @@
+<?php $s = '<?php $s = \'...\'; echo strtr($s, [str_repeat(\'.\', 3) => $s]);'; echo strtr($s, [str_repeat('.', 3) => $s]);
diff --git a/src/try-quine5.php b/src/try-quine5.php
new file mode 100644
index 0000000..9f0f38b
--- /dev/null
+++ b/src/try-quine5.php
@@ -0,0 +1 @@
+<?php $s = '<?php $s = \'...\'; echo strtr($s, [str_repeat(\'.\', 3) => addslashes($s)]);'; echo strtr($s, [str_repeat('.', 3) => addslashes($s)]); \ No newline at end of file
diff --git a/src/try-quine6.php b/src/try-quine6.php
new file mode 100644
index 0000000..8a2cea2
--- /dev/null
+++ b/src/try-quine6.php
@@ -0,0 +1 @@
+<?php $s = 'echo strtr("<?php \$s = \'...\'; eval(\$s);", [str_repeat(\'.\', 3) => addcslashes($s, chr(39))]);'; eval($s); \ No newline at end of file