{"id":3469,"date":"2026-09-26T09:20:57","date_gmt":"2026-09-26T00:20:57","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=3469"},"modified":"2026-09-26T09:20:57","modified_gmt":"2026-09-26T00:20:57","slug":"20260828-00mtcjux","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2026\/09\/26\/20260828-00mtcjux\/","title":{"rendered":"\u300c\u30ac\u30c1\u30e3\u306e\u78ba\u7387\u300d\u3092\u5b9f\u88c5\u3057\u305f\u3089\u3001\u305d\u308c\u306f\u78ba\u7387\u3067\u306f\u306a\u304f\u91cd\u307f\u4ed8\u3051\u3060\u3063\u305f"},"content":{"rendered":"<h2>\u3053\u306e\u8a18\u4e8b\u306e\u30c6\u30fc\u30de<\/h2>\n<p>\u3042\u308b\u30a2\u30df\u30e5\u30fc\u30ba\u30e1\u30f3\u30c8\u7cfb\u30b7\u30b9\u30c6\u30e0\u306e\u6848\u4ef6\u3067\u3001\u3044\u308f\u3086\u308b\u300c\u30ac\u30c1\u30e3\uff08\u62bd\u9078\uff09\u300d\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u4ed5\u69d8\u66f8\u306b\u306f\u5f53\u305f\u308a\u524d\u306e\u3088\u3046\u306b <strong>\u300c\u78ba\u7387\u300d<\/strong> \u3068\u3044\u3046\u8a00\u8449\u304c\u4e26\u3093\u3067\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u8981\u4ef6\u3092\u8a70\u3081\u3066\u3044\u304f\u3046\u3061\u306b\u3001\u904b\u7528\u5074\u304c\u672c\u5f53\u306b\u6c42\u3081\u3066\u3044\u305f\u306e\u306f\u78ba\u7387\u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f <strong>\u300c\u91cd\u307f\u4ed8\u3051\u306b\u3088\u308b\u51fa\u73fe\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u300d<\/strong> \u3060\u3063\u305f\u3053\u3068\u304c\u5206\u304b\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u78ba\u7387\u3068\u91cd\u307f\u4ed8\u3051\u306e\u9055\u3044\u3001\u30ec\u30a2\u5ea6\u30fb\u90e8\u4f4d\u30fb\u66dc\u65e5\u3068\u3044\u3063\u305f\u8907\u6570\u306e\u8ef8\u3067\u51fa\u73fe\u7387\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u8a2d\u8a08\u3001\u305d\u3057\u3066 Laravel \u3067\u306e\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u306a\u304a\u3001\u6570\u5024\u3084\u30c9\u30e1\u30a4\u30f3\u540d\u306f\u3059\u3079\u3066\u533f\u540d\u5316\u30fb\u4e00\u822c\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u52d5\u4f5c\u74b0\u5883<\/h2>\n<ul>\n<li>PHP 8.2 \u7cfb<\/li>\n<li>Laravel 10 \u7cfb<\/li>\n<li>MySQL 8.0<\/li>\n<li>\u9650\u5b9a\u7684\u306a Clean Architecture \u69cb\u6210\uff08Repository \/ UseCase \u3092\u5206\u96e2\uff09<\/li>\n<\/ul>\n<h2>\u300c\u78ba\u7387\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u4f9d\u983c\u304b\u3089\u59cb\u307e\u3063\u305f\u554f\u984c<\/h2>\n<p>\u62bd\u9078\u6a5f\u80fd\u306e\u4ed5\u69d8\u306f\u3001\u6700\u521d\u3053\u3046\u66f8\u304b\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>&gt; \u30ec\u30a2\u5ea6\u3054\u3068\u306b\u78ba\u7387\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307b\u3057\u3044\u3002<\/p>\n<p>\u4e00\u898b\u3059\u308b\u3068\u30b7\u30f3\u30d7\u30eb\u306a\u8981\u4ef6\u3067\u3059\u3002\u3068\u3053\u308d\u304c\u3001\u5b9f\u969b\u306b\u904b\u7528\u62c5\u5f53\u8005\u3068\u4f1a\u8a71\u3092\u3057\u3066\u3044\u304f\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u8981\u671b\u304c\u6b21\u3005\u3068\u51fa\u3066\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u300c\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u3060\u3051\u3001\u3082\u3046\u5c11\u3057\u51fa\u306b\u304f\u304f\u3057\u305f\u3044\u300d<\/li>\n<li>\u300c\u571f\u65e5\u3060\u3051\u30ec\u30a2\u3092\u51fa\u3084\u3059\u304f\u3057\u305f\u3044\u300d<\/li>\n<li>\u300c\u201c\u304a\u307e\u3082\u308a\u201d\u7cfb\u306e\u30a2\u30a4\u30c6\u30e0\u306f\u5168\u4f53\u7684\u306b\u7d5e\u308a\u305f\u3044\u300d<\/li>\n<\/ul>\n<p>\u3053\u308c\u3089\u3092 <strong>\u300c\u78ba\u7387\uff08\u5408\u8a08\u304c100%\u306b\u306a\u308b\u6570\u5024\uff09\u300d<\/strong> \u3067\u7ba1\u7406\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u9014\u7aef\u306b\u904b\u7528\u304c\u7834\u7dbb\u3057\u307e\u3059\u3002\u3068\u3044\u3046\u306e\u3082\u3001<strong>1\u3064\u306e\u5024\u3092\u3044\u3058\u308b\u3068\u4ed6\u306e\u5168\u30a2\u30a4\u30c6\u30e0\u306e\u78ba\u7387\u304c\u9023\u52d5\u3057\u3066\u5909\u308f\u3063\u3066\u3057\u307e\u3046<\/strong> \u304b\u3089\u3067\u3059\u3002\u30a2\u30a4\u30c6\u30e0\u304c\u5897\u3048\u305f\u308a\u6e1b\u3063\u305f\u308a\u3059\u308b\u305f\u3073\u306b\u3001\u5168\u4f53\u3092\u518d\u8a08\u7b97\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u904b\u7528\u62c5\u5f53\u8005\u304c\u300c\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u3060\u3051\u7d5e\u308a\u305f\u3044\u300d\u3068\u601d\u3063\u3066\u3082\u3001\u305d\u306e1\u64cd\u4f5c\u304c\u5168\u30a2\u30a4\u30c6\u30e0\u306b\u6ce2\u53ca\u3057\u3066\u3057\u307e\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<h2>\u306a\u305c\u30ba\u30ec\u308b\u306e\u304b \u2014 \u904b\u7528\u304c\u89e6\u308a\u305f\u3044\u306e\u306f\u300c\u5272\u5408\u300d\u3067\u306f\u306a\u304b\u3063\u305f<\/h2>\n<p>\u305d\u3082\u305d\u3082\u904b\u7528\u5074\u304c\u89e6\u308a\u305f\u304b\u3063\u305f\u306e\u306f\u300c\u5168\u4f53\u306b\u5bfe\u3059\u308b\u53b3\u5bc6\u306a\u5272\u5408\u300d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<strong>\u300c\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u3092\u3001\u76f8\u5bfe\u7684\u306b\u3069\u308c\u304f\u3089\u3044\u51fa\u3057\u305f\u3044\u304b\u300d<\/strong> \u3068\u3044\u3046\u611f\u899a\u5024\u3067\u3057\u305f\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u5fc5\u8981\u3060\u3063\u305f\u306e\u306f\u78ba\u7387\u3067\u306f\u306a\u304f <strong>\u91cd\u307f\uff08weight\uff09<\/strong> \u3067\u3059\u3002<\/p>\n<ul>\n<li>\u91cd\u307f\u306e\u6570\u5024\u304c\u9ad8\u3044\u30a2\u30a4\u30c6\u30e0\u307b\u3069\u5f53\u305f\u308a\u3084\u3059\u3044<\/li>\n<li>\u4f4e\u3044\u30a2\u30a4\u30c6\u30e0\u307b\u3069\u5f53\u305f\u308a\u306b\u304f\u3044<\/li>\n<li>\u5404\u30a2\u30a4\u30c6\u30e0\u306b\u72ec\u7acb\u3057\u305f\u6570\u5024\u3092\u632f\u308c\u308b\uff08\u4ed6\u3092\u3044\u3058\u3089\u306a\u304f\u3066\u3044\u3044\uff09<\/li>\n<\/ul>\n<p>\u3053\u3053\u3067\u300c\u78ba\u7387\u300d\u3068\u3044\u3046\u8a00\u8449\u306e\u307e\u307e\u5b9f\u88c5\u3092\u9032\u3081\u3066\u3057\u307e\u3046\u3068\u3001UI\u30fbDB\u30fb\u30ed\u30b8\u30c3\u30af\u306e\u3059\u3079\u3066\u304c <strong>\u300c\u5408\u8a08100%\u524d\u63d0\u300d<\/strong> \u3067\u56fa\u307e\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u3046\u306a\u308b\u3068\u3001\u5f8c\u304b\u3089\u300c\u66dc\u65e5\u5909\u52d5\u300d\u306e\u3088\u3046\u306a\u8abf\u6574\u8ef8\u3092\u8db3\u3057\u305f\u304f\u306a\u3063\u3066\u3082\u3001\u6839\u672c\u304b\u3089\u4f5c\u308a\u76f4\u3057\u306b\u306a\u308a\u304b\u306d\u307e\u305b\u3093\u3002\u7528\u8a9e\u306e\u9078\u629e\u304c\u3001\u305d\u306e\u307e\u307e\u8a2d\u8a08\u306e\u67d4\u8edf\u6027\u3092\u5de6\u53f3\u3059\u308b\u306e\u3067\u3059\u3002<\/p>\n<h2>\u5bfe\u5fdc\u65b9\u91dd<\/h2>\n<h3>1. \u7528\u8a9e\u3092\u300c\u91cd\u307f\u4ed8\u3051\u300d\u306b\u7d71\u4e00\u3059\u308b<\/h3>\n<p>\u307e\u305a\u3001\u4ed5\u69d8\u66f8\u30fb\u7ba1\u7406\u753b\u9762\u30fb\u30b3\u30fc\u30c9\u4e0a\u306e\u8868\u73fe\u3092 <strong>\u300c\u78ba\u7387\u300d\u304b\u3089\u300c\u91cd\u307f\u4ed8\u3051\u300d\u3078\u7d71\u4e00<\/strong> \u3057\u307e\u3057\u305f\u3002\u30a8\u30f3\u30c9\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306e\u8868\u5411\u304d\u306e\u8868\u793a\u306f\u300c\u78ba\u7387\u300d\u306e\u307e\u307e\u3067\u3082\u69cb\u3044\u307e\u305b\u3093\u304c\u3001\u5185\u90e8\u5b9f\u88c5\u3068\u7ba1\u7406\u5024\u306f\u91cd\u307f\u3067\u3042\u308b\u3053\u3068\u3092\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u660e\u8a18\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u3046\u3048\u3067\u3001\u91cd\u307f\u306e\u632f\u308b\u821e\u3044\u3092\u6b21\u306e\u3088\u3046\u306b\u30c1\u30fc\u30e0\u30fb\u904b\u7528\u5074\u3068\u5408\u610f\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6700\u5927\u5024\u3068\u6700\u5c0f\u5024\u306e\u5dee\u304c\u5927\u304d\u3044 \u2192 \u6700\u5c0f\u5024\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u3088\u308a\u5f53\u305f\u308a\u306b\u304f\u3044<\/li>\n<li>\u5dee\u304c\u5c0f\u3055\u3044 \u2192 \u51fa\u73fe\u7387\u304c\u8fd1\u3065\u304f<\/li>\n<li>\u5168\u3066\u540c\u3058\u5024 \u2192 \u51fa\u73fe\u7387\u5dee\u306f\u306a\u304f\u306a\u308b\uff08\u5747\u7b49\uff09<\/li>\n<\/ul>\n<p>\u3053\u306e\u4e00\u6587\u3092\u6700\u521d\u306b\u63e1\u3063\u3066\u304a\u304f\u3060\u3051\u3067\u3001\u5f8c\u306e\u8abf\u6574\u304c\u3059\u3079\u3066\u300c\u611f\u899a\u3068\u4e00\u81f4\u300d\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u904b\u7528\u62c5\u5f53\u8005\u304c\u6570\u5024\u3092\u3044\u3058\u3063\u305f\u3068\u304d\u306e\u7d50\u679c\u304c\u76f4\u611f\u3069\u304a\u308a\u306b\u306a\u308b\u3001\u3068\u3044\u3046\u306e\u306f\u5730\u5473\u3067\u3059\u304c\u975e\u5e38\u306b\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002<\/p>\n<h3>2. \u91cd\u307f\u3092\u8907\u6570\u306e\u8ef8\u3067\u6301\u3064<\/h3>\n<p>\u51fa\u73fe\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30921\u3064\u306e\u6570\u5024\u306b\u62bc\u3057\u8fbc\u3081\u305a\u3001<strong>\u8ef8\u3054\u3068\u306b\u72ec\u7acb\u3057\u305f\u91cd\u307f<\/strong> \u3092\u6301\u305f\u305b\u307e\u3057\u305f\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u8ef8<\/th>\n<th>\u7bc4\u56f2<\/th>\n<th>\u5f79\u5272<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u30ec\u30a2\u5ea6<\/td>\n<td>1\u301c100<\/td>\n<td>\u30ec\u30a2\u307b\u3069\u6570\u5024\u3092\u4f4e\u304f\u3057\u3066\u51fa\u306b\u304f\u304f\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u90e8\u4f4d\u5225<\/td>\n<td>1\u301c100<\/td>\n<td>\u90e8\u4f4d\u5358\u4f4d\u3067\u51fa\u3084\u3059\u3055\u3092\u8abf\u6574\uff08\u7279\u5b9a\u30ab\u30c6\u30b4\u30ea\u3092\u7d5e\u308b\u7b49\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u66dc\u65e5\u52a0\u7b97<\/td>\n<td>0\u301c100<\/td>\n<td>\u30ec\u30a2\u5ea6\u306e\u51fa\u73fe\u7387\u306e\u307f\u306b\u4e0a\u4e57\u305b\uff080\u306a\u3089\u5f71\u97ff\u306a\u3057\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5f15\u304d\u5f53\u3066\u306f\u300c\u95a2\u9023\u3059\u308b\u91cd\u307f\u306e\u5408\u8a08\u300d\u3067\u884c\u3044\u307e\u3059\u3002\u8ef8\u3092\u5206\u3051\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u300c\u571f\u65e5\u3060\u3051\u30ec\u30a2\u3092\u5e95\u4e0a\u3052\u3059\u308b\u300d\u3068\u3044\u3063\u305f\u8abf\u6574\u3092\u3001<strong>\u4ed6\u306e\u8ef8\u3092\u58ca\u3055\u305a\u306b<\/strong> \u8db3\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u88c5\u4f8b<\/h2>\n<p>\u91cd\u307f\u4ed8\u304d\u62bd\u9078\u306e\u6838\u306b\u306a\u308b\u306e\u306f\u3001<strong>\u7d2f\u7a4d\u548c\u3068\u4e71\u6570<\/strong> \u3067\u3059\u3002\u5408\u8a08100%\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u4e00\u5207\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:default decode:true\">\/**\n * \u91cd\u307f\u4ed8\u304d\u62bd\u9078\n *\n * @param array&lt;int, int&gt; $weights \u30a2\u30a4\u30c6\u30e0ID =&gt; \u91cd\u307f\uff080\u4ee5\u4e0b\u306f\u9664\u5916\uff09\n * @return int \u5f53\u9078\u3057\u305f\u30a2\u30a4\u30c6\u30e0ID\n *\/\npublic function draw(array $weights): int\n{\n    $weights = array_filter($weights, static fn (int $w): bool =&gt; $w &gt; 0);\n\n    $total = array_sum($weights);\n    if ($total &lt;= 0) {\n        throw new \\RuntimeException('\u62bd\u9078\u5bfe\u8c61\u306e\u91cd\u307f\u304c0\u3067\u3059');\n    }\n\n    \/\/ 1\u301c\u5408\u8a08 \u306e\u4e00\u69d8\u4e71\u6570\u3002random_int \u306f\u6697\u53f7\u8ad6\u7684\u306b\u5b89\u5168\u306a\u4e71\u6570\n    $rand = random_int(1, $total);\n\n    $cursor = 0;\n    foreach ($weights as $itemId =&gt; $weight) {\n        $cursor += $weight;\n        if ($rand &lt;= $cursor) {\n            return $itemId;\n        }\n    }\n\n    \/\/ \u4e38\u3081\u8aa4\u5dee\u306a\u3069\u3082\u7121\u3044\u6574\u6570\u6f14\u7b97\u306a\u306e\u3067\u7406\u8ad6\u4e0a\u5230\u9054\u3057\u306a\u3044\u304c\u3001\u4fdd\u967a\n    return (int) array_key_last($weights);\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u8907\u6570\u306e\u8ef8\u3092\u5408\u6210\u3057\u3066\u6700\u7d42\u7684\u306a\u91cd\u307f\u3092\u7d44\u307f\u7acb\u3066\u308b\u90e8\u5206\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u5206\u3051\u3066\u304a\u304f\u3068\u898b\u901a\u3057\u304c\u826f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">\/**\n * \u30a2\u30a4\u30c6\u30e0\u3054\u3068\u306e\u6700\u7d42\u91cd\u307f\u3092\u7d44\u307f\u7acb\u3066\u308b\u3002\n * \u66dc\u65e5\u52a0\u7b97\u306f\u300c\u30ec\u30a2\u5ea6\u306e\u51fa\u73fe\u7387\u300d\u306b\u3060\u3051\u52b9\u304f\u306e\u304c\u30dd\u30a4\u30f3\u30c8\u3002\n *\/\npublic function buildWeights(array $items, int $weekdayBonus): array\n{\n    $weights = [];\n\n    foreach ($items as $item) {\n        \/\/ \u30ec\u30a2\u5ea6\u306e\u91cd\u307f + \u66dc\u65e5\u52a0\u7b97\uff08\u66dc\u65e5\u5909\u52d5\u304c\u52b9\u304f\u306e\u306f\u3053\u3053\u3060\u3051\uff09\n        $rarityWeight = $item-&gt;rarityWeight + $weekdayBonus;\n\n        \/\/ \u90e8\u4f4d\u306e\u91cd\u307f\u3068\u5408\u7b97\u3057\u3066\u3001\u305d\u306e\u30a2\u30a4\u30c6\u30e0\u306e\u5f15\u304d\u5f53\u3066\u91cd\u307f\u3092\u6c7a\u3081\u308b\n        $weights[$item-&gt;id] = $rarityWeight + $item-&gt;partWeight;\n    }\n\n    return $weights;\n}<\/pre>\n<p>\u62bd\u9078\u30ed\u30b8\u30c3\u30af\u306f UseCase\uff08Interactor\uff09\u5074\u306b\u7f6e\u304d\u3001DB \u30a2\u30af\u30bb\u30b9\u306f Repository \u306b\u9589\u3058\u8fbc\u3081\u307e\u3059\u3002\u3053\u3046\u3057\u3066\u304a\u304f\u3068\u3001\u62bd\u9078\u30ed\u30b8\u30c3\u30af\u304c\u300c\u3069\u3053\u304b\u3089\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u3063\u3066\u304f\u308b\u304b\u300d\u3092\u77e5\u3089\u305a\u306b\u6e08\u3080\u305f\u3081\u3001\u30c6\u30b9\u30c8\u3082\u683c\u6bb5\u306b\u66f8\u304d\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30c6\u30b9\u30c8\u306b\u3088\u308b\u691c\u8a3c<\/h2>\n<p>\u91cd\u307f\u4ed8\u304d\u62bd\u9078\u306f\u300c\u78ba\u7387\u7684\u306b\u6b63\u3057\u3044\u304b\u300d\u3092\u691c\u8a3c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3068\u306f\u3044\u3048\u4e71\u6570\u3092\u305d\u306e\u307e\u307e\u30c6\u30b9\u30c8\u306b\u6301\u3061\u8fbc\u3080\u3068\u7d50\u679c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u305f\u3081\u3001<strong>\u4e71\u6570\u305d\u306e\u3082\u306e\u306f\u30e2\u30c3\u30af\u3057\u3001\u5883\u754c\u5024\u3067\u6c7a\u5b9a\u7684\u306b\u691c\u8a3c<\/strong> \u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">public function test_\u5883\u754c\u5024\u3067\u3061\u3087\u3046\u3069\u5f53\u305f\u308b\u30a2\u30a4\u30c6\u30e0\u304c\u9078\u3070\u308c\u308b(): void\n{\n    $weights = [\n        1 =&gt; 10, \/\/ \u7d2f\u7a4d 1\u301c10\n        2 =&gt; 20, \/\/ \u7d2f\u7a4d 11\u301c30\n        3 =&gt; 70, \/\/ \u7d2f\u7a4d 31\u301c100\n    ];\n\n    \/\/ random_int \u304c 11 \u3092\u8fd4\u3059\u72b6\u6cc1\u3092\u60f3\u5b9a\u3057\u305f\u691c\u8a3c\n    \/\/ \uff08\u5b9f\u88c5\u3067\u306f\u4e71\u6570\u751f\u6210\u3092\u6ce8\u5165\u53ef\u80fd\u306b\u3057\u3066\u304a\u304f\uff09\n    $this-&gt;assertSame(2, $this-&gt;service-&gt;drawWith($weights, rand: 11));\n    $this-&gt;assertSame(1, $this-&gt;service-&gt;drawWith($weights, rand: 10));\n    $this-&gt;assertSame(3, $this-&gt;service-&gt;drawWith($weights, rand: 31));\n}<\/pre>\n<p>\u5206\u5e03\u305d\u306e\u3082\u306e\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u5927\u91cf\u306b\u8a66\u884c\u3057\u3066\u5404\u30a2\u30a4\u30c6\u30e0\u306e\u51fa\u73fe\u5272\u5408\u304c\u300c\u91cd\u307f\u6bd4\u300d\u306b\u53ce\u675f\u3059\u308b\u304b\u3092\u3001<strong>\u7de9\u3044\u8a31\u5bb9\u8aa4\u5dee<\/strong> \u3067\u30a2\u30b5\u30fc\u30c8\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u7d71\u8a08\u7684\u306a\u691c\u8a3c\u306b\u306a\u308b\u305f\u3081\u3001\u8aa4\u5dee\u5e45\u306f\u5e83\u3081\u306b\u53d6\u3063\u3066\u304a\u304f\u306e\u304c\u73fe\u5b9f\u7684\u3067\u3059\u3002<\/p>\n<h2>\u5b9f\u88c5\u30fb\u904b\u7528\u6642\u306e\u6ce8\u610f\u70b9<\/h2>\n<ul>\n<li><strong>\u4e71\u6570\u306f <code>rand()<\/code> \u3067\u306f\u306a\u304f <code>random_int()<\/code> \u3092\u4f7f\u3046\u3002<\/strong> \u504f\u308a\u3068\u4e88\u6e2c\u53ef\u80fd\u6027\u3092\u907f\u3051\u308b\u305f\u3081\u3067\u3059\u3002<\/li>\n<li><strong>\u91cd\u307f\u306f\u6574\u6570\u3067\u6301\u3064\u3002<\/strong> \u5c0f\u6570\u306b\u3059\u308b\u3068\u7d2f\u7a4d\u548c\u306e\u4e38\u3081\u8aa4\u5dee\u304c\u751f\u3058\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u96e3\u3057\u304f\u306a\u308a\u307e\u3059\u3002<\/li>\n<li><strong>\u5408\u8a08\u3092\u56fa\u5b9a\u3057\u306a\u3044\u3002<\/strong> \u30a2\u30a4\u30c6\u30e0\u306e\u8ffd\u52a0\u30fb\u524a\u9664\u306e\u305f\u3073\u306b\u5168\u4f53\u3092\u518d\u8a08\u7b97\u3057\u306a\u304f\u3066\u6e08\u3080\u3053\u3068\u304c\u3001\u91cd\u307f\u4ed8\u3051\u306e\u6700\u5927\u306e\u5229\u70b9\u3067\u3059\u3002<\/li>\n<li><strong>\u300c\u66dc\u65e5\u52a0\u7b97\u304c\u52b9\u304f\u8ef8\u300d\u3092\u660e\u78ba\u306b\u3059\u308b\u3002<\/strong> \u4eca\u56de\u306f\u300c\u30ec\u30a2\u5ea6\u306e\u307f\u300d\u306b\u52b9\u304b\u305b\u307e\u3057\u305f\u3002\u3053\u3053\u304c\u66d6\u6627\u3060\u3068\u3001\u904b\u7528\u5074\u306e\u671f\u5f85\u3068\u5b9f\u88c5\u304c\u30ba\u30ec\u307e\u3059\u3002<\/li>\n<li><strong>\u8868\u793a\u306f\u300c\u78ba\u7387\u300d\u3067\u3082\u5b9f\u88c5\u306f\u300c\u91cd\u307f\u300d<\/strong> \u3068\u5272\u308a\u5207\u308a\u3001\u305d\u306e\u5dee\u3092\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u6b8b\u3057\u3066\u304a\u304f\u3002<\/li>\n<\/ul>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u300c\u78ba\u7387\u3092\u5b9f\u88c5\u3057\u3066\u307b\u3057\u3044\u300d\u3068\u3044\u3046\u4f9d\u983c\u306e\u88cf\u306b\u3042\u3063\u305f\u306e\u306f\u3001\u78ba\u7387\u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f <strong>\u76f8\u5bfe\u7684\u306a\u51fa\u3084\u3059\u3055\uff1d\u91cd\u307f\u4ed8\u3051<\/strong> \u3067\u3057\u305f\u3002\u7528\u8a9e\u3092\u65e9\u3044\u6bb5\u968e\u3067\u300c\u91cd\u307f\u4ed8\u3051\u300d\u306b\u7d71\u4e00\u3057\u3001\u51fa\u73fe\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u8907\u6570\u306e\u72ec\u7acb\u3057\u305f\u8ef8\u306b\u5206\u3051\u305f\u3053\u3068\u3067\u3001\u5f8c\u304b\u3089\u6765\u305f\u300c\u66dc\u65e5\u3060\u3051\u8abf\u6574\u3057\u305f\u3044\u300d\u3068\u3044\u3063\u305f\u8981\u671b\u3082\u7834\u7dbb\u306a\u304f\u53d6\u308a\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u62bd\u9078\u6a5f\u80fd\u3092\u4f5c\u308b\u3068\u304d\u306f\u3001\u307e\u305a <strong>\u300c\u3053\u308c\u306f\u78ba\u7387\u304b\u3001\u91cd\u307f\u304b\u300d<\/strong> \u3092\u904b\u7528\u5074\u3068\u63e1\u308b\u3068\u3053\u308d\u304b\u3089\u59cb\u3081\u308b\u3002\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001\u5b9f\u88c5\u3082\u904b\u7528\u3082\u3050\u3063\u3068\u697d\u306b\u306a\u308a\u307e\u3059\u3002\u4ed5\u69d8\u66f8\u306b\u66f8\u304b\u308c\u305f\u8a00\u8449\u3092\u305d\u306e\u307e\u307e\u5b9f\u88c5\u306b\u843d\u3068\u3059\u306e\u3067\u306f\u306a\u304f\u3001\u305d\u306e\u8a00\u8449\u306e\u88cf\u306b\u3042\u308b\u672c\u5f53\u306e\u8981\u6c42\u3092\u78ba\u304b\u3081\u308b\u3053\u3068\u3002\u305d\u308c\u304c\u3001\u5f8c\u3005\u306e\u8a2d\u8a08\u306e\u7834\u7dbb\u3092\u9632\u3050\u4e00\u756a\u306e\u30dd\u30a4\u30f3\u30c8\u3060\u3068\u611f\u3058\u305f\u6848\u4ef6\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3042\u308b\u30a2\u30df\u30e5\u30fc\u30ba\u30e1\u30f3\u30c8\u7cfb\u30b7\u30b9\u30c6\u30e0\u306e\u6848\u4ef6\u3067\u3001\u3044\u308f\u3086\u308b\u300c\u30ac\u30c1\u30e3\uff08\u62bd\u9078\uff09\u300d\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u6a5f\u4f1a\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u4ed5\u69d8\u66f8\u306b\u306f\u5f53\u305f\u308a\u524d\u306e\u3088\u3046\u306b \u300c\u78ba\u7387\u300d \u3068\u3044\u3046\u8a00\u8449\u304c\u4e26\u3093\u3067\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u8981\u4ef6\u3092\u8a70\u3081\u3066\u3044\u304f\u3046\u3061\u306b\u3001\u904b\u7528\u5074\u304c\u672c\u5f53\u306b\u6c42\u3081\u3066\u3044\u305f\u306e\u306f\u78ba\u7387\u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f\u2026<\/p>\n","protected":false},"author":1,"featured_media":3468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[34],"tags":[153,291,1188,477],"class_list":["post-3469","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-memorandum","tag-laravel","tag-291","tag-1188","tag-477"],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2026\/09\/20260828-00mtcjux-thumbnail.png","_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=3469"}],"version-history":[{"count":1,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3469\/revisions"}],"predecessor-version":[{"id":3470,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3469\/revisions\/3470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/3468"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=3469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=3469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=3469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}